prior | R Documentation |
Calculates the density at theta
of either the normal, Student's t, or uniform distribution.
prior(catObj, theta)
catObj |
An object of class |
theta |
A numeric value at which to evaluate the prior |
The priorName
slot of Cat
object needs to be either "UNIFORM"
, "NORMAL"
, or "STUDENT_T"
.
When priorName
slot is "NORMAL"
, the first element of priorParams
slot is the mean,
the second element is the standard deviation.
When priorName
slot is "STUDENT_T"
, the first
element of priorParams
slot is the non-centrality parameters and the second is degrees of freedom.
When priorName
slot is "UNIFORM"
, the elements of the priorParams
slot are the lower and upper bounds,
of the interval, respectively. Note that the "UNIFORM"
is only applicable for the expected a posteriori (EAP) estimation method.
The function prior
returns a numeric consisting of prior value, π(θ), given the value θ.
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++
code.
This function uses Boost C++
source libraries for the uniform and Student's t
distributions and calls dnorm4
written in C
which is identical to that
of dnorm
in R
.
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
Cat-class
## Loading ltm Cat object data(ltm_cat) ## Prior calculation for different distributions ltm_cat@priorName <- "NORMAL" ltm_cat@priorParams <- c(0, 1) ## Parameters are mean and standard deviation prior(ltm_cat, theta = 1) ltm_cat@priorName <- "STUDENT_T" ltm_cat@priorParams <- c(1, 3) ## Parameters are non-centrality param and degrees of freedom prior(ltm_cat, theta = 1) ltm_cat@priorName <- "UNIFORM" ltm_cat@priorParams <- c(-1, 1) ## Parameters are lower bound and upper bound of interval prior(ltm_cat, theta = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.