Learn R Programming

catSurv (version 1.5.0)

prior: 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)

Value

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

Arguments

catObj

An object of class Cat.

theta

A numeric value at which to evaluate the prior

Author

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

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.

See Also

Cat-class

Examples

Run this code
## 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)


Run the code above in your browser using DataLab