Description Usage Arguments Details Value Warning Author(s) See Also Examples
postmode numerically computes the posterior mode for a specified posterior distribution of the latent of an item response model.
1 |
fmodel |
Function with first argument |
y |
Vector of length m for a single response pattern, or matrix of size s by m of a set of s item response patterns. In the latter case the posterior is computed by conditioning on the event that the response pattern is one of the s response patterns. Elements of |
zmin |
Minimum value of ζ to use in searching for the mode. |
zmax |
Maximum value of ζ to use in searching for the mode. |
... |
Additional arguments to pass to |
This is basically wrapper for optimize to find the maximum of a log-posterior or log-likelihood function of a latent trait. Note that this is the MAP estimator, and also the MLE if the prior distribution is uniform.
zeta |
The value of ζ that maximizes the posterior distribution. |
post |
The value of the log-posterior distribution at the mode. |
Finding the mode is not guaranteed. Inspection of the profile of the posterior (perhaps by using posttrace) is recommended to verify that zmin and zmax are set appropriately. Problems can arise for posterior distributions that are multimodal or where no (finite) mode exists.
Timothy R. Johnson
See optimize for information on using this function.
1 2 3 4 5 6 7 8 9 10 | alph <- c(1.27,1.34,1.14,1,0.67) # discrimination parameters
beta <- c(1.19,0.59,0.15,-0.59,-2) # difficulty parameters
gamm <- c(0.1,0.15,0.15,0.2,0.01) # lower asymptote parameters
# MAP estimate given a sum score of 3
postmode(fmodel3pl, patterns(5, 2, 3), apar = alph, bpar = beta, cpar = gamm)
# MLE given a sum score of 3
postmode(fmodel3pl, patterns(5, 2, 3), apar = alph, bpar = beta, cpar = gamm,
prior = function(z) 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.