fmodelgrp: Latent Trait Posterior of the Probit Graded Response Model

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

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

Usage

1
fmodelgrp(zeta, y, apar, 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.

apar

Vector of length m of "discrimination" parameters.

bpar

Matrix of size m by r-1 of "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 graded response model used here is

P(Y_{ij} ≥ y|ζ_i) = Φ(α_j(ζ_i-β_{jy}))

for y = 1,…,r-1, where α_j and β_{jk} are the "discrimination" and "difficulty" parameters, respectively, for the k-th cumulative item response function, and Φ is the distribution function of a standard normal distribution. Note that the difficulty parameters must meet the constraint that β_{j,k+1} ≥ β_{jk} for k = 1,…,r-1 so that all item response probabilities are non-negative. This model was first proposed by Samejima (1969, 1972).

Value

post

The log of the unnormalized posterior distribution evaluated at zeta.

prob

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

Note

This function is designed to be called by other functions in the ltbayes package, but could be useful on its own.

Author(s)

Timothy R. Johnson

References

Samejima, F. (1969). Estimation of ability using a response pattern of graded scores. Psychometrikka Monograph, No. 17.

Samejima, F. (1972). A general model for free-response data. Psychometrika Monograph, No. 18.

See Also

See fmodelgrl for the logit variant of this model.

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
25
26
27
28
29
30
samp <- 5000 # samples from posterior distribution
burn <- 1000 # burn-in samples to discard

alph <- rep(1, 3)                           # discrimination parameters
beta <- matrix(c(-1,1), 3, 2, byrow = TRUE) # difficulty parameters

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

information(fmodelgrp, c(0,1,2), 
	apar = alph, bpar = beta) # Fisher information

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

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

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

Related to fmodelgrp in ltbayes...