fmodelseq: Latent Trait Posterior for the Sequential Response Model

Description Usage Arguments Details Value Author(s) References Examples

Description

fmodelseq evaluates the (unnormalized) posterior density of the latent trait of a sequential item response model with a given prior distribution, and computes the probability for each item and response category given the latent trait.

Usage

1
fmodelseq(zeta, y, bpar, prior = dnorm, ...)

Arguments

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 y should be integers from 0 to r-1 where r is the number of response categories.

bpar

Matrix of size m by r-1 of step "difficulty" parameters.

prior

Function that evaluates the prior distribution of the latent trait. The default is the standard normal distribution.

...

Additional arguments to be passed to prior.

Details

The parameterization of the sequential model is such that

P(Y_{ij} > y|Y_{ij} ≥ y,ζ_i) = 1/(1 + \exp(-(ζ_i-β_{j,y+1})))

for y = 0, 1, …, r-2. This model is dicussed by Tutz (1990, 1997) and Verhelst, Glas, and de Vries (1997).

Value

post

The log of the unnormalized posterior distribution evaluated at zeta.

prob

Matrix of size m by 2 array of item response probabilities.

Author(s)

Timothy R. Johnson

References

Tutz, G. (1990). Sequential item response models with an ordered response. British Journal of Mathematical and Statistical Psychology, 43, 39-55.

Tutz, G. (1997). Sequential models for ordered responses. In W. J. van der Linden & R. K. Hambleton (Eds.), Handbook of item response theory (pp. 139-152). New York: Springer-Verlag.

Verhelst, N. D., Glas, C. A. W., \& de Vries, H. H. (1997). A steps model to analyze partial credit. In W. J. van der Linden & R. K. Hambleton (Eds.), Handbook of item response theory (pp. 123-138). New York: Springer-Verlag.

Examples

 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 <- matrix(0, 5, 2)

post <- postsamp(fmodelseq, c(0,1,2,1,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(fmodelseq, c(0,1,2,1,0), bpar = beta),
	plot(zeta, post, type = "l")) # profile of log-posterior density

information(fmodelseq, c(0,1,2,1,0), bpar = beta) # Fisher information

with(post, mean(zeta)) # posterior mean
postmode(fmodelseq, c(0,1,2,1,0), bpar = beta) # posterior mode

with(post, quantile(zeta, probs = c(0.025, 0.975))) # posterior credibility interval
profileci(fmodelseq, c(0,1,2,1,0), bpar = beta) # profile likelihood confidence interval

ltbayes documentation built on May 2, 2019, 12:40 p.m.

Related to fmodelseq in ltbayes...