lsirm1pl_ss {lsirm12pl} | R Documentation |
1PL LSIRM with model selection approach.
Description
lsirm1pl_ss is used to fit 1PL LSIRM with model selection approach based on spike-and-slab priors. LSIRM factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. The resulting latent space provides an interaction map that represents interactions between respondents and items.
Usage
lsirm1pl_ss(
data,
ndim = 2,
niter = 15000,
nburn = 2500,
nthin = 5,
nprint = 500,
jump_beta = 0.4,
jump_theta = 1,
jump_gamma = 1,
jump_z = 0.5,
jump_w = 0.5,
pr_mean_beta = 0,
pr_sd_beta = 1,
pr_mean_theta = 0,
pr_spike_mean = -3,
pr_spike_sd = 1,
pr_slab_mean = 0.5,
pr_slab_sd = 1,
pr_a_theta = 0.001,
pr_b_theta = 0.001,
pr_xi_a = 1,
pr_xi_b = 1,
verbose = FALSE
)
Arguments
data |
Matrix; a binary or continuous item response matrix for analysis. Each row represents a respondent, and each column contains responses to the corresponding item. |
ndim |
Integer; the dimension of the latent space. Default is 2. |
niter |
Integer; the total number of MCMC iterations to run. Default is 15000. |
nburn |
Integer; the number of initial MCMC iterations to discard as burn-in. Default is 2500. |
nthin |
Integer; the number of MCMC iterations to thin. Default is 5. |
nprint |
Integer; the interval at which MCMC samples are displayed during execution. Default is 500. |
jump_beta |
Numeric; the jumping rule for the beta proposal density. Default is 0.4. |
jump_theta |
Numeric; the jumping rule for the theta proposal density. Default is 1.0. |
jump_gamma |
Numeric; the jumping rule for the theta proposal density. Default is 1.0. |
jump_z |
Numeric; the jumping rule for the z proposal density. Default is 0.5. |
jump_w |
Numeric; the jumping rule for the w proposal density. Default is 0.5. |
pr_mean_beta |
Numeric; the mean of the normal prior for beta. Default is 0. |
pr_sd_beta |
Numeric; the standard deviation of the normal prior for beta. Default is 1.0. |
pr_mean_theta |
Numeric; the mean of the normal prior for theta. Default is 0. |
pr_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
pr_a_theta |
Numeric; the shape parameter of the inverse gamma prior for the variance of theta. Default is 0.001. |
pr_b_theta |
Numeric; the scale parameter of the inverse gamma prior for the variance of theta. Default is 0.001. |
pr_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
Details
lsirm1pl_ss
models the probability of correct response by respondent j
to item i
with item effect \beta_i
, respondent effect \theta_j
and the distance between latent position w_i
of item i
and latent position z_j
of respondent j
in the shared metric space, with \gamma
represents the weight of the distance term:
logit(P(Y_{j,i} = 1|\theta_j,\beta_i,\gamma,z_j,w_i))=\theta_j+\beta_i-\gamma||z_j-w_i||
lsirm1pl_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
Value
lsirm1pl_ss
returns an object of list containing the following components:
data |
Data frame or matrix containing the variables used in the model. |
bic |
A numeric value representing the Bayesian Information Criterion (BIC). |
mcmc_inf |
Details about the number of MCMC iterations, burn-in periods, and thinning intervals. |
map_inf |
The log maximum a posteriori (MAP) value and the iteration number at which this MAP value occurs. |
beta_estimate |
Posterior estimates of the beta parameter. |
theta_estimate |
Posterior estimates of the theta parameter. |
sigma_theta_estimate |
Posterior estimates of the standard deviation of theta. |
gamma_estimate |
Posterior estimates of gamma parameter. |
z_estimate |
Posterior estimates of the z parameter. |
w_estimate |
Posterior estimates of the w parameter. |
beta |
Posterior samples of the beta parameter. |
theta |
Posterior samples of the theta parameter. |
theta_sd |
Posterior samples of the standard deviation of theta. |
gamma |
Posterior samples of the gamma parameter. |
z |
Posterior samples of the z parameter, represented as a 3-dimensional matrix where the last axis denotes the dimension of the latent space. |
w |
Posterior samples of the w parameter, represented as a 3-dimensional matrix where the last axis denotes the dimension of the latent space. |
accept_beta |
Acceptance ratio for the beta parameter. |
accept_theta |
Acceptance ratio for the theta parameter. |
accept_z |
Acceptance ratio for the z parameter. |
accept_w |
Acceptance ratio for the w parameter. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
pi_estimate |
Posterior estimation of phi. inclusion probability of gamma. if estimation of phi is less than 0.5, choose Rasch model with gamma = 0, otherwise latent space model with gamma > 0. |
pi |
Posterior samples of phi which is indicator of spike and slab prior. If phi is 1, log gamma follows the slab prior, otherwise follows the spike prior. |
References
Ishwaran, H., & Rao, J. S. (2005). Spike and slab variable selection: Frequentist and Bayesian strategies (Vol. 33). The Annals of Statistics
Examples
# generate example item response matrix
data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50)
lsirm_result <- lsirm1pl_ss(data)
# The code following can achieve the same result.
lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE))