Fit a single-chain ordinal LSIRM (GRM 2PL)
lsirmgrm2pl_o(
data,
ncat = NULL,
missing_data = NA,
missing.val = 99,
ndim = 2,
niter = 15000,
nburn = 2500,
nthin = 5,
nprint = 500,
jump_beta = 0.4,
jump_theta = 1,
jump_alpha = 1,
jump_gamma = 0.2,
jump_z = 0.5,
jump_w = 0.5,
pr_mean_beta = 0,
pr_sd_beta = 1,
pr_mean_theta = 0,
pr_sd_theta = 1,
pr_mean_alpha = 0.5,
pr_sd_alpha = 1,
pr_mean_gamma = 0.5,
pr_sd_gamma = 1,
pr_a_theta = 0.001,
pr_b_theta = 0.001,
fixed_gamma = FALSE,
spikenslab = FALSE,
pr_spike_mean = -3,
pr_spike_sd = 1,
pr_slab_mean = 0.5,
pr_slab_sd = 1,
pr_xi_a = 1,
pr_xi_b = 1,
adapt = NULL,
verbose = FALSE,
fix_theta_sd = FALSE,
fix_alpha_1 = TRUE
)A list containing MCMC draws and posterior summaries, including:
beta, theta, gamma, alpha, z, w: MCMC draws.
beta_estimate, theta_estimate, gamma_estimate, alpha_estimate, z_estimate,
w_estimate: posterior means.
If missing_data = "mar", the list additionally includes imp and imp_estimate for the imputed
ordinal responses.
Matrix; an ordinal (ordered categorical) item response matrix. Each row represents a respondent, and
each column represents an item. Values can be either 0:(K-1) or 1:K. Missing values can be NA.
Integer; number of categories \(K\). If NULL, it is inferred from the observed data.
Character; the type of missing data assumed. Options are NA, "mar", or
"mcar". If NA and data contains missing values, it is set to "mcar" internally.
Numeric; numeric code used to represent missing values in the C++ sampler. Default is 99.
Integer; latent space dimension. Default is 2.
Integer; total MCMC iterations. Default is 15000.
Integer; burn-in iterations. Default is 2500.
Integer; thinning interval. Default is 5.
Integer; print interval if verbose=TRUE. Default is 500.
Numeric; proposal SD for GRM thresholds. Default is 0.4. During MCMC sampling, threshold proposals are constrained to maintain the ordering \(\beta_{i,1} > \beta_{i,2} > \cdots > \beta_{i,K-1}\) for each item.
Numeric; proposal SD for theta. Default is 1.
Numeric; proposal SD on log-scale for \(\alpha\). Default is 1.
Numeric; proposal SD on log-scale for gamma. Default is 0.2.
Numeric; proposal SD for z. Default is 0.5.
Numeric; proposal SD for w. Default is 0.5.
Numeric; prior mean for thresholds. Default is 0.
Numeric; prior SD for thresholds. Default is 1.
Numeric; prior mean for theta. Default is 0.
Numeric; prior SD for theta. Default is 1.
Numeric; log-normal prior mean for \(\alpha\). Default is 0.5.
Numeric; log-normal prior SD for \(\alpha\). Default is 1.
Numeric; log-normal prior mean for gamma. Default is 0.5.
Numeric; log-normal prior SD for gamma. Default is 1.
Numeric; shape for inverse-gamma prior on var(theta). Default is 0.001.
Numeric; scale for inverse-gamma prior on var(theta). Default is 0.001.
Logical; if TRUE, fixes \(\gamma = 1\) (no sampling). Default is FALSE.
Logical; if TRUE, uses spike-and-slab priors for \(\gamma\). Default is FALSE.
Numeric; prior mean for the spike component (on log-scale). Default is -3.
Numeric; prior SD for the spike component (on log-scale). Default is 1.
Numeric; prior mean for the slab component (on log-scale). Default is 0.5.
Numeric; prior SD for the slab component (on log-scale). Default is 1.
Numeric; Beta prior shape a for mixing weight \(\xi\). Default is 1.
Numeric; Beta prior shape b for mixing weight \(\xi\). Default is 1.
List; optional adaptive MCMC control. If not NULL, proposal standard deviations are adapted during the burn-in period to reach a target acceptance rate and are held fixed during the main MCMC sampling.
When adaptation is enabled, the reported acceptance ratios in the output (accept_beta, accept_theta, accept_alpha, etc.) are computed only from iterations after burn-in, reflecting the performance of the adapted proposal distributions.
Elements of the list can include:
use_adapt: Logical; if TRUE, adaptive MCMC is used. Default is FALSE.
adapt_interval: Integer; the number of iterations between each update of the proposal SDs. Default is 100.
adapt_rate: Numeric; Robbins-Monro scaling constant (c) in step size formula: adapt_rate / iteration^decay_rate. Default is 1.0. Valid range: any positive value. Recommended: 0.5-2.0.
decay_rate: Numeric; Robbins-Monro decay exponent (alpha) in step size formula. Default is 0.5. Valid range: (0.5, 1]. Recommended: 0.5-0.8.
target_accept: Numeric; target acceptance rate for scalar parameters (beta, theta, gamma, alpha). Default is 0.44.
target_accept_zw: Numeric; target acceptance rate for multi-dimensional latent positions z and w. Default is 0.234.
target_accept_beta/theta/alpha/gamma: Numeric; (optional) parameter-specific target acceptance rates to override target_accept.
Logical; If TRUE, MCMC progress and parameter samples are printed to the console during execution. Default is FALSE.
Logical; If TRUE, the standard deviation of the respondent latent positions \(\theta\) is fixed at 1 instead of being sampled. Default is FALSE.
Logical; if TRUE, fixes \(\alpha_1 = 1\). Default is TRUE.