| fit.MGPCM | R Documentation |
Fits a multidimensional generalization of the partial credit model to polytomous (multi-category) response data. Two estimation backends are provided: full Bayesian inference via Hamiltonian Monte Carlo (Stan) and a fast stochastic-EM algorithm (iStEM).
fit.MGPCM(
data,
D = NULL,
Q.matrix = NULL,
length.poly = NULL,
method = c("iStEM", "stan"),
control.model = NULL,
control.method = NULL
)
data |
An |
D |
Integer; number of latent dimensions ( |
Q.matrix |
An optional |
length.poly |
Optional integer scalar or length- |
method |
Estimation method: |
control.model |
A named list of model-level hyperparameters. Supported entries:
|
control.method |
A named list of method-specific tuning parameters. Common entries (used by both Stan and iStEM):
Stan-specific entries:
iStEM-specific entries:
|
An object of class "MGPCM" with components:
nparNumber of free parameters.
method"stan" or "iStEM".
thetaList with est, se, Rhat
(N \times D).
parList with est, se, Rhat,
free (I \times (D + K_{max})). Columns are
a1..aD, d0, d1, ..., d_{K_{max}-1}.
CorrList with est, se, Rhat
(D \times D).
length.polyInteger vector of per-item category counts.
logLikMarginal log-likelihood (class "logLik").
call, argumentsCall and argument records.
Let Y_{ij} \in \{0, 1, \dots, K_i - 1\} denote the categorical
response of person j = 1, \dots, N to item i = 1, \dots, I,
where K_i \ge 2 is the number of response categories for item
i. Let \boldsymbol{\theta}_j be the D-dimensional
latent trait vector.
The category response probability implemented in both the C++ and Stan backends is a softmax over category scores:
P(Y_{ij} = k \mid \boldsymbol{\theta}_j) =
\frac{
\exp\{k\,\eta_{ij} + d_{ik}\}
}{
\sum_{r=0}^{K_i-1} \exp\{r\,\eta_{ij} + d_{ir}\}
},
\qquad k = 0, 1, \dots, K_i - 1,
where
\eta_{ij} = \sum_{d=1}^{D} a_{id}\,\theta_{jd}.
The discrimination parameters satisfy a_{id} > 0 when
q_{id} = 1 and a_{id} = 0 when q_{id} = 0. The
d_{ik} values are category intercepts, not cumulative step
difficulties; d_{i0} = 0 is fixed for identification and
d_{i1}, \dots, d_{i,K_i-1} are free.
This formulation nests the standard (unidimensional) generalized partial
credit model (Muraki, 1992) when D = 1 and all q_{i1} = 1.
Prior distributions:
a_{id} (free)Log-normal: \log a_{id} \sim N(\mu_a, \sigma_a^2)
d_{ik} (free)Normal:
d_{ik} \sim N(\mu_d, \sigma_d^2) for k \ge 1;
d_{i0}=0 is fixed. The same normal penalty is used by
Stan and by the iStEM item update when use.prior = TRUE.
\boldsymbol{\theta}_jMultivariate normal:
\boldsymbol{\theta}_j \sim N_D(\mathbf{0}, \boldsymbol{\Sigma})
method = "stan"):Full Bayesian inference via HMC. The joint posterior is sampled
with multiple chains, providing posterior means, standard deviations,
and \hat{R} diagnostics.
method = "iStEM"):Improved Stochastic EM alternating finite-grid block Gibbs person-sampling and item-parameter optimization (L-BFGS-B). Convergence monitored via Geweke diagnostics and batch-means MC error.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159–176. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/014662169201600206")}
Yao, L., & Schwarz, R. D. (2006). A multidimensional partial credit model for polytomous data. Applied Psychological Measurement, 30(4), 295–318.
sim.data.MGPCM, get.fit.index.MGPCM,
logLik.MGPCM, rotate
sim <- sim.data.MGPCM(N = 20, I = 6, D = 2, length.poly = 4)
fit <- fit.MGPCM(sim$response, D = 2, method = "iStEM",
control.method = list(
vis = FALSE, seed = 123,
M = 2, B = 2, burnin.maxitr = 2,
maxitr = 3, eps1 = 10, eps2 = 10,
estimate.se = FALSE))
head(fit$theta$est)
fit$par$est[1:5, ]
gof <- get.fit.index(fit)
summary(gof)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.