#include <ItemParamPrior.h>
Public Member Functions | |
ItemParamPrior (RealVector ¶m) | |
Constructor assigning values of prior parameters from a vector. | |
ItemParamPrior (int numparam) | |
Constructor setting the number of prior parameters, but not values of the parameters. | |
virtual | ~ItemParamPrior () |
Virtual destructor used here so that the correct destructor gets called in derived classes. | |
void | SetParameters (RealVector ¶m) |
Assigns item parameter from vector. | |
RealVector | GetParameters () |
Returns parameter vector for this item. | |
virtual int | NumParameters ()=0 |
Returns number of prior distribution parameters for the IRT parameter. | |
virtual bool | ZeroDensity (Real) |
Returns true if density at p is zero. By default the density is non-zero at all points. | |
virtual Real | NearestNonZero (Real x) |
If x has density zero, this function returns the value closest to x that has a non-zero density. | |
virtual Real | LogDensity (Real p)=0 |
Returns the log of the density function. | |
virtual Real | DerivLogDensity1 (Real p)=0 |
Returns the first derivative of the log density. | |
virtual Real | DerivLogDensity2 (Real p)=0 |
Returns the second derivative of the log density. | |
virtual std::string | DistributionName () const =0 |
Returns the string containing name of distribution used for prior. | |
Protected Attributes | |
RealVector | mParameters |
Parameters of prior distribution. |
Definition at line 39 of file ItemParamPrior.h.
etirm::ItemParamPrior::ItemParamPrior | ( | RealVector & | param | ) |
Constructor assigning values of prior parameters from a vector.
[in] | ¶m | Address of parameter vector for this item. |
Definition at line 29 of file ItemParamPrior.cpp.
00029 : 00030 mParameters(param) 00031 { 00032 }
etirm::ItemParamPrior::ItemParamPrior | ( | int | numparam | ) | [explicit] |
Constructor setting the number of prior parameters, but not values of the parameters.
[in] | numparam | Number of parameter for this item. |
Definition at line 35 of file ItemParamPrior.cpp.
00035 : 00036 mParameters(numparam) 00037 { 00038 }
etirm::ItemParamPrior::~ItemParamPrior | ( | ) | [virtual] |
Virtual destructor used here so that the correct destructor gets called in derived classes.
Definition at line 41 of file ItemParamPrior.cpp.
void etirm::ItemParamPrior::SetParameters | ( | RealVector & | param | ) |
Assigns item parameter from vector.
[in] | ¶m | Address of parameter vector for this item. |
Definition at line 46 of file ItemParamPrior.cpp.
References mParameters, and NumParameters().
00047 { 00048 if (param.size() != NumParameters()) // Changed "==" to "!=" (ww, 2-22-2008) 00049 throw InvalidArgument("Invalid number of parameters in prior distribution", 00050 "ItemParamPrior::SetParameters"); 00051 00052 mParameters = param; 00053 }
RealVector etirm::ItemParamPrior::GetParameters | ( | ) |
Returns parameter vector for this item.
Definition at line 56 of file ItemParamPrior.cpp.
References mParameters.
00057 { 00058 return RealVector(mParameters); 00059 }
virtual int etirm::ItemParamPrior::NumParameters | ( | ) | [pure virtual] |
Returns number of prior distribution parameters for the IRT parameter.
Defined in derived class to return number of parameters in prior density.
Implemented in etirm::ItemParamPriorBeta4, etirm::ItemParamPriorLogNormal, and etirm::ItemParamPriorNormal.
Referenced by SetParameters().
virtual bool etirm::ItemParamPrior::ZeroDensity | ( | Real | ) | [inline, virtual] |
Returns true if density at p is zero. By default the density is non-zero at all points.
Reimplemented in etirm::ItemParamPriorBeta4, and etirm::ItemParamPriorLogNormal.
Definition at line 84 of file ItemParamPrior.h.
If x has density zero, this function returns the value closest to x that has a non-zero density.
The Default is to assume all values of x have a non-zero density.
[in] | x | Quadrature point. |
Reimplemented in etirm::ItemParamPriorBeta4, and etirm::ItemParamPriorLogNormal.
Definition at line 99 of file ItemParamPrior.h.
Returns the log of the density function.
Implemented in etirm::ItemParamPriorBeta4, etirm::ItemParamPriorLogNormal, and etirm::ItemParamPriorNormal.
Returns the first derivative of the log density.
Implemented in etirm::ItemParamPriorBeta4, etirm::ItemParamPriorLogNormal, and etirm::ItemParamPriorNormal.
Returns the second derivative of the log density.
Implemented in etirm::ItemParamPriorBeta4, etirm::ItemParamPriorLogNormal, and etirm::ItemParamPriorNormal.
virtual std::string etirm::ItemParamPrior::DistributionName | ( | ) | const [pure virtual] |
Returns the string containing name of distribution used for prior.
Implemented in etirm::ItemParamPriorBeta4, etirm::ItemParamPriorLogNormal, and etirm::ItemParamPriorNormal.
RealVector etirm::ItemParamPrior::mParameters [protected] |
Parameters of prior distribution.
Definition at line 119 of file ItemParamPrior.h.
Referenced by etirm::ItemParamPriorNormal::DerivLogDensity1(), etirm::ItemParamPriorLogNormal::DerivLogDensity1(), etirm::ItemParamPriorBeta4::DerivLogDensity1(), etirm::ItemParamPriorLogNormal::DerivLogDensity2(), etirm::ItemParamPriorBeta4::DerivLogDensity2(), GetParameters(), etirm::ItemParamPriorBeta4::ItemParamPriorBeta4(), etirm::ItemParamPriorLogNormal::ItemParamPriorLogNormal(), etirm::ItemParamPriorNormal::ItemParamPriorNormal(), etirm::ItemParamPriorNormal::LogDensity(), etirm::ItemParamPriorLogNormal::LogDensity(), etirm::ItemParamPriorBeta4::LogDensity(), etirm::ItemParamPriorBeta4::NearestNonZero(), SetParameters(), and etirm::ItemParamPriorBeta4::ZeroDensity().