fit.TIRT: Fit the Thurstonian Item Response Theory (TIRT) Model

View source: R/fit.TIRT.R

fit.TIRTR Documentation

Fit the Thurstonian Item Response Theory (TIRT) Model

Description

Fits the Thurstonian IRT model for forced-choice data. Unlike the FCMIRT/FCGGUM models that operate on the item-level endorsement probabilities, the TIRT model works directly at the level of paired comparisons: each pairwise comparison is treated as a binary outcome governed by a latent difference process with a probit link.

Usage

fit.TIRT(
  data,
  Q.matrix,
  block.items = NULL,
  fc.type = NULL,
  method = c("iStEM", "stan"),
  control.model = NULL,
  control.method = NULL
)

Arguments

data

An N \times B forced-choice data matrix with ranking strings (e.g., "2>1>3").

Q.matrix

An I \times D matrix with entries -1, 0, 1. Each row must have exactly one non-zero entry that assigns the statement to a specific dimension with a sign indicating the scoring direction.

block.items

A list of length B giving item indices in each block. Parsed from data if NULL.

fc.type

Forced-choice response type: "RANK" (default), "MOLE", or "PICK".

method

Estimation method: "iStEM" (default) or "stan".

control.model

A named list of model-level hyperparameters for the Thurstonian IRT model. Supported entries:

lambda.alpha, lambda.beta

Lower and upper bounds for free loading magnitudes \lambda_i. Defaults: 0.40, 0.90. Stan uses \lambda_i \sim U(\lambda_{\min}, \lambda_{\max}), where these two controls supply \lambda_{\min} and \lambda_{\max}; iStEM uses the same values as optimization bounds unless lambda.lower or lambda.upper is supplied in control.method.

psi.mu, psi.sigma

Prior mean and SD for uniqueness standard deviations \psi_i (normal, truncated to positive values). Defaults: 0.80, 0.30. The prior \psi_i \sim N_+(0.80, 0.30^2) reflects the expectation that uniqueness SDs are moderate in size. Note that the model parameterizes the uniqueness variance \psi_i^2, so the prior on the SD scale is transformed accordingly.

gamma.mu, gamma.sigma

Prior mean and SD for pairwise intercepts \gamma_{ik} (normal). Defaults: 0, 0.8. The skew-symmetry constraint \gamma_{ik} = -\gamma_{ki} is automatically enforced. Unobserved pairwise comparisons (in MOLE/PICK designs) have their \gamma parameters fixed to gamma.mu.

theta.mu

Mean vector for the iStEM normal kernel for \boldsymbol{\theta}_j. Default: rep(0, D). The current Stan model accepts this value in its data list but centers \boldsymbol{\theta}_j at zero.

L

Theta grid size per dimension for marginal log-likelihood computation and iStEM block Gibbs sampling. Default adapts to D.

theta.lower, theta.upper

Bounds for the theta grid used by marginal log-likelihood computation and iStEM block Gibbs sampling. Defaults: -6, 6.

control.method

A named list of method-specific tuning parameters. Common entries (used by both Stan and iStEM):

cores

Number of CPU cores for parallel chains (Stan) or ignored (iStEM). Default: the number of chains.

vis

Logical; if TRUE (default), prints progress information to the console.

seed

Random seed for reproducibility. Default: a random integer.

Stan-specific entries:

chains

Number of MCMC chains (default: 2).

iter

Total iterations per chain (default: 5000).

warmup

Warmup/burn-in iterations per chain (default: iter / 2).

thin

Thinning interval (default: 1).

init

Initial values: "random" (default) for uniform(-2, 2) initialization, or a list of initial values per chain.

algorithm

MCMC algorithm: "HMC" (default), "HMC", or "Fixed_param".

adapt_delta

Target average acceptance probability (NUTS; default: 0.95). The TIRT model's pairwise probit likelihood typically mixes well; however, for high-dimensional models (D > 5) or models with many fixed parameters, consider increasing to 0.9.

max_treedepth

Maximum tree depth (NUTS; default: 10). Increase if "max treedepth exceeded" warnings appear.

stepsize

Initial step size for the leapfrog integrator (auto-tuned by Stan if not set).

int_time

Total integration time for HMC trajectories (only when algorithm = "HMC").

metric

Mass matrix type: "unit_e", "diag_e" (default), or "dense_e".

adapt_engaged

Logical; if TRUE (default), warmup adaptation is enabled.

adapt_init_buffer, adapt_term_buffer, adapt_window

Warmup adaptation scheduling parameters (defaults: 25, 50, 25).

iStEM-specific entries:

M

Number of burn-in batches retained for Geweke convergence diagnosis (default: 10; must be \ge 2).

B

Batch size: MCMC iterations per batch (default: 20).

burnin.maxitr

Maximum burn-in batches (default: 100).

maxitr

Maximum total batches (default: 2000).

eps1

Geweke z-score convergence threshold for burn-in (default: 1.5).

eps2

Monte Carlo error tolerance for the final chain (default: 0.4).

frac1, frac2

Fractions for the Geweke diagnostic (defaults: 0.1, 0.5).

corr.optim.maxit

Maximum L-BFGS-B iterations for the constrained unit-diagonal correlation update (default: 50).

optim.maxit

Maximum L-BFGS-B iterations per parameter block during structural parameter updates (default: 50). Applies to the optimization of \lambda, \psi^2, and \gamma parameters.

fix.corr

Logical; if TRUE, the inter-trait correlation matrix is fixed to the identity (default: FALSE). Useful when orthogonal dimensions are theoretically expected.

estimate.se

Logical; if TRUE (default), standard errors are computed from the final Monte Carlo chain.

lambda.lower, lambda.upper

Bounds on free loading magnitudes during iStEM optimization. Defaults are lambda.alpha and lambda.beta from control.model.

psi.lower, psi.upper

Bounds on uniqueness standard deviations \psi_i during iStEM optimization (defaults: 1e-4 and 5). The reported par matrix stores \psi_i^2.

gamma.lower, gamma.upper

Bounds on pairwise intercepts \gamma_{ik} during iStEM optimization (defaults: -6 and 6).

Value

An object of class "TIRT" containing:

npar

Number of free parameters.

method

"stan" or "iStEM".

theta

List with est, se, Rhat (N \times D).

par

List with est, se, Rhat, free (I \times (D + 1)). Columns include the loading \lambda_i on the design dimension and \psi_i^2.

Corr

List with est, se, Rhat (D \times D).

gamma.matrix

List with est, se, Rhat (I \times I); pairwise intercept matrix.

pairs.matrix, pairs.value, response, response.total

Pairwise and response data structures.

logLik

Marginal log-likelihood (class "logLik").

Model Specification

Pairwise utility difference. For a pair of statements (i, k) in block b, the latent comparative judgment is:

y_{j,ik}^* = -\gamma_{ik} + \lambda_i \sum_{d=1}^{D} q_{id}\,\theta_{jd} - \lambda_k \sum_{d=1}^{D} q_{kd}\,\theta_{jd} + \varepsilon_{j,i} - \varepsilon_{j,k},

where:

  • \gamma_{ik} is the pairwise intercept (unfolding threshold parameter). Skew-symmetry requires \gamma_{ik} = -\gamma_{ki}.

  • \lambda_i > 0 is the loading magnitude of statement i; the sign of the statement direction is carried by q_{id}.

  • q_{id} \in \{-1, 0, 1\} is the Q-matrix entry; each row has exactly one non-zero entry.

  • \varepsilon_{j,i} \sim N(0, \psi_i^2) is the uniqueness (error) of statement i.

Binary pairwise response. The observed response is

Y_{j,ik} = \begin{cases} 1, & \text{if } y_{j,ik}^* \ge 0 \quad (\text{prefer } i \text{ over } k), \\ 0, & \text{otherwise}. \end{cases}

Under the normality of errors, the probability is:

P(Y_{j,ik} = 1 \mid \boldsymbol{\theta}_j) = \Phi\!\left( \frac{ -\gamma_{ik} + \lambda_i\,\mathbf{q}_i'\boldsymbol{\theta}_j - \lambda_k\,\mathbf{q}_k'\boldsymbol{\theta}_j }{ \sqrt{\psi_i^2 + \psi_k^2} } \right),

where \Phi(\cdot) is the standard normal CDF.

Identification constraints. Several standard constraints are applied:

  • Case A (I_{\text{block}} = 2, D > 2): All \psi_i^2 = 0.5 are fixed.

  • Case B (D = 2, I_{\text{block}} = 2): The first block's \lambda_i are fixed to 0.80, all \psi_i^2 = 0.5 are fixed.

  • General case: The last item in each block has \psi_i^2 = 1.0 fixed. Pairwise \gamma_{ik} parameters for comparisons that are never observed under the supplied RANK/MOLE/PICK design are fixed to gamma.mu.

Correlation structure. The inter-trait correlation matrix \boldsymbol{\Sigma} is estimated as in the MIRT model. In the Stan file, \boldsymbol{\theta}_j is centered at zero; the iStEM backend uses control.model$theta.mu as the mean in the normal kernel.

Estimation Methods

Stan (method = "stan"):

Full Bayesian inference via HMC. The probit likelihood is evaluated over all pairwise comparisons.

iStEM (method = "iStEM"):

Improved Stochastic EM. Person sampling uses finite-grid block Gibbs; structural parameters (\lambda, \psi^2, \gamma) updated via optimization or closed-form steps.

References

Brown, A., & Maydeu-Olivares, A. (2011). Item response modeling of forced-choice questionnaires. Educational and Psychological Measurement, 71(3), 460–502. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/0013164410375112")}

Maydeu-Olivares, A., & Brown, A. (2010). Item response modeling of paired comparison and ranking data. Multivariate Behavioral Research, 45(6), 935–974.

Thurstone, L. L. (1927). A law of comparative judgment. Psychological Review, 34(4), 273–286.

See Also

sim.data.TIRT, get.fit.index.TIRT, logLik.TIRT

Examples

sim <- sim.data.TIRT(N.person = 20, N.block = 3, I.block = 2,
                     D = 2, fc.type = "RANK")
fit <- fit.TIRT(sim$data, Q.matrix = sim$Q.matrix,
                block.items = sim$block.items,
                fc.type = "RANK", 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)
cor(fit$theta$est, sim$theta)
gof <- get.fit.index(fit)
summary(gof)


ForceChoice documentation built on Sept. 13, 2026, 1:06 a.m.