prior {catSurv}R Documentation

Evaluate the Prior Density Distribution at Position theta

Description

Calculates the density at theta of either the normal, Student's t, or uniform distribution.

Usage

prior(catObj, theta)

Arguments

catObj

An object of class Cat.

theta

A numeric value at which to evaluate the prior

Details

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.

Value

The function prior returns a numeric consisting of prior value, \pi(\theta), given the value \theta.

Note

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.

Author(s)

Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil

See Also

Cat-class

Examples

## 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)



[Package catSurv version 1.5.0 Index]