etirm::ItemParamPriorNormal Class Reference

Class derived from ItemParamPrior representing a normal prior distribution of item parameters for use in Bayes modal estimation. More...

#include <ItemParamPriorNormal.h>

Inheritance diagram for etirm::ItemParamPriorNormal:

Inheritance graph
[legend]
Collaboration diagram for etirm::ItemParamPriorNormal:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ItemParamPriorNormal ()
 Default constructor - assigns uniform distribution.
 ItemParamPriorNormal (RealVector &param)
 Constructor taking vector of parameters.
 ItemParamPriorNormal (Real mean, Real sd)
 Constructor taking mean and standard deviation as arguments.
virtual int NumParameters ()
 Returns number of prior Normal distribution parameters for the IRT item.
virtual Real LogDensity (Real p)
 Returns log-density of p.
virtual Real DerivLogDensity1 (Real p)
 Returns first derivative of log density.
virtual Real DerivLogDensity2 (Real p)
 Returns second derivative of log density.
virtual std::string DistributionName () const
 Returns string containing name of distribution used for prior.

Private Attributes

Real variance
 Variance of Normal distribution.


Detailed Description

Class derived from ItemParamPrior representing a normal prior distribution of item parameters for use in Bayes modal estimation.

Definition at line 40 of file ItemParamPriorNormal.h.


Constructor & Destructor Documentation

etirm::ItemParamPriorNormal::ItemParamPriorNormal (  ) 

Default constructor - assigns uniform distribution.

Definition at line 80 of file ItemParamPriorNormal.cpp.

References etirm::ItemParamPrior::mParameters, and variance.

00080                                              :
00081     ItemParamPrior(2)
00082   {
00083     mParameters[0] = 0.0;
00084     mParameters[1] = 1.0;
00085 
00086     variance = 1.0;
00087   }

etirm::ItemParamPriorNormal::ItemParamPriorNormal ( RealVector param  ) 

Constructor taking vector of parameters.

Parameters:
[in] &param Parameter vector of length 2: param[0] = Normal prior mean, param[1] = Normal prior standard deviation.
Note: The second element of param is the standard deviation, NOT the variance.

Definition at line 49 of file ItemParamPriorNormal.cpp.

References variance.

00049                                                               :
00050     ItemParamPrior(param)
00051   {
00052     variance = param(2) * param(2);
00053   }

etirm::ItemParamPriorNormal::ItemParamPriorNormal ( Real  mean,
Real  sd 
)

Constructor taking mean and standard deviation as arguments.

Parameters:
[in] mean Normal prior mean.
[in] sd Normal prior standard deviation.
Note: The second parameter is the standard deviation, NOT the variance.

Definition at line 64 of file ItemParamPriorNormal.cpp.

References etirm::ItemParamPrior::mParameters, and variance.

00064                                                                :
00065     ItemParamPrior(2)
00066   {
00067     if (sd <= 0.0)
00068       throw RuntimeError("Invalid s.d. for normal prior",
00069           "ItemParamPriorNormal::ItemParamPriorNormal");
00070 
00071     mParameters[0] = mean;
00072     mParameters[1] = sd;
00073 
00074     variance = sd * sd;
00075   }


Member Function Documentation

virtual int etirm::ItemParamPriorNormal::NumParameters (  )  [inline, virtual]

Returns number of prior Normal distribution parameters for the IRT item.

Implements etirm::ItemParamPrior.

Definition at line 49 of file ItemParamPriorNormal.h.

00050     {
00051       return 2;
00052     }

Real etirm::ItemParamPriorNormal::LogDensity ( Real  p  )  [virtual]

Returns log-density of p.

Parameters:
[in] p Argument of log density function (an item parameter value).
Note: Returns only the part of the log of the density that depends on the parameter.

Implements etirm::ItemParamPrior.

Definition at line 97 of file ItemParamPriorNormal.cpp.

References etirm::ItemParamPrior::mParameters, and variance.

00098   {
00099     Real value = p - mParameters[0];
00100     value *= value;
00101     value /= -2.0 * variance;
00102 
00103     return value;
00104   }

Real etirm::ItemParamPriorNormal::DerivLogDensity1 ( Real  p  )  [virtual]

Returns first derivative of log density.

Parameters:
[in] p Argument of log density function (an item parameter value).
Note: Returns only the part of the log of the density that depends on the parameter.

Implements etirm::ItemParamPrior.

Definition at line 114 of file ItemParamPriorNormal.cpp.

References etirm::ItemParamPrior::mParameters, and variance.

00115   {
00116     return -(p - mParameters[0])/variance;
00117   }

Real etirm::ItemParamPriorNormal::DerivLogDensity2 ( Real  p  )  [virtual]

Returns second derivative of log density.

Parameters:
[in] p Argument of log density function (an item parameter value).
Note: Returns 0nly the part of the log of the density that depends on the parameter.

Implements etirm::ItemParamPrior.

Definition at line 127 of file ItemParamPriorNormal.cpp.

References variance.

00128   {
00129     return -1.0/variance;
00130   }

virtual std::string etirm::ItemParamPriorNormal::DistributionName (  )  const [inline, virtual]

Returns string containing name of distribution used for prior.

Implements etirm::ItemParamPrior.

Definition at line 63 of file ItemParamPriorNormal.h.


Member Data Documentation

Real etirm::ItemParamPriorNormal::variance [private]

Variance of Normal distribution.

Definition at line 73 of file ItemParamPriorNormal.h.

Referenced by DerivLogDensity1(), DerivLogDensity2(), ItemParamPriorNormal(), and LogDensity().


The documentation for this class was generated from the following files:
Generated on Sat Mar 1 21:41:55 2008 for ETIRM by  doxygen 1.5.4