Description Usage Arguments Details Value Note Author(s) See Also Examples
fmodel1pp
evaluates the (unnormalized) posterior density of the latent trait of a one-parameter binary probit item response model with given prior distribution, and computes the probabilities for each item and response category given the latent trait.
1 |
zeta |
Latent trait value. |
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 |
bpar |
Vector of m "difficulty" parameters. |
prior |
Function that evaluates the prior distribution of the latent trait. The default is a standard normal distribution. |
... |
Additional arguments to be passed to |
The item response model is parameterized as
P(Y_{ij} = 1|ζ_i) = Φ(ζ_i - β_j),
where where β_j is the difficulty parameter (bpar
), ζ_i is the latent trait (zeta
), and Φ is the distribution function of a standard normal distribution.
post |
The log of the unnormalized posterior distribution evaluated at |
prob |
Matrix of size m by 2 array of item response probabilities. |
This function is designed to be called by other functions in the ltbayes package, but could be useful on its own. This function calls fmodel4pp
since it is a special case.
Timothy R. Johnson
See fmodel2pp
, fmodel3pp
, and fmodel4pp
for related models, and fmodel1pl
for the logit variant of this model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | samp <- 5000 # samples from posterior distribution
burn <- 1000 # burn-in samples to discard
beta <- -2:2 # difficulty parameters
post <- postsamp(fmodel1pp, c(1,1,0,0,0),
bpar = beta, control = list(nbatch = samp + burn))
post <- data.frame(sample = 1:samp,
zeta = post$batch[(burn + 1):(samp + burn)])
with(post, plot(sample, zeta), type = "l") # trace plot of sampled realizations
with(post, plot(density(zeta, adjust = 2))) # density estimate of posterior distribution
with(posttrace(fmodel1pp, c(1,1,0,0,0),
bpar = beta), plot(zeta, post, type = "l")) # profile of log-posterior density
information(fmodel1pp, c(1,1,0,0,0), bpar = beta) # Fisher information
with(post, mean(zeta)) # posterior mean
postmode(fmodel1pp, c(1,1,0,0,0), bpar = beta) # posterior mode
with(post, quantile(zeta, probs = c(0.025, 0.975))) # posterior credibility interval
profileci(fmodel1pp, c(1,1,0,0,0), bpar = beta) # profile likelihood confidence interval
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.