variationalDCM {variationalDCM}R Documentation

Variational Bayesian estimation for DCMs

Description

variationalDCM() fits DCMs by VB algorithms.

Usage

variationalDCM(X, Q, model, max_it = 500, epsilon = 1e-04, verbose = TRUE, ...)

## S3 method for class 'variationalDCM'
summary(object, ...)

Arguments

X

N×JN \times J item response data for the DINA, DINO, MC-DINA, and saturated DCM models. Alternatively, TT-length list or 3-dim array whose elements are N×J/TN \times J/T binary item response data matrices for the HM-DCM

Q

J×KJ \times K binary Q-matrix for the DINA, DINO, and saturated DCM models. For the MC-DINA model, its size should be J×(K+2)J \times (K+2). Alternatively, TT-length list or 3-dim array whose elements are J/T×KJ/T \times K Q-matrices for the HM-DCM

model

specify one of "dina", "dino", "mc_dina", "satu_dcm", and "hm_dcm"

max_it

Maximum number of iterations (default: 500)

epsilon

convergence tolerance for iterations (default: 1e-4)

verbose

logical, controls whether to print progress (default: TRUE)

...

additional arguments such as hyperparameter values

object

the return of the variationalDCM function and the argument of our summary function

Value

variationalDCM returns an object of class variationalDCM. We provide the summary function to summarize a result and users can check the following information:

model_params

estimates of posteror means and posterior standard deviations of model parameters

attr_mastery_pat

MAP etimates of attribute mastery patterns

ELBO

resulting value of evidence lower bound

time

time spent in computation

Methods (by generic)

variationalDCM

The variationalDCM() function performs recently-developed variational Bayesian inference for various DCMs. The current version can support the DINA, DINO, MC-DINA, saturated DCM, HM-DCM models. We briefly introduce additional arguments that are specific to each model.

DINA model

The DINA model has two types of model parameters: slip sjs_j and guessing gjg_j for j=1,,Jj=1,\cdots,J. We name the hyperparameters for the DINA model: delta_0 is a L-dimensional vector, which is a hyperparameter δ0\boldsymbol{\delta}^0 for the Dirichlet distribution for the class mixing parameter π\boldsymbol{\pi} (default: NULL). When delta_0 is specified as NULL, we set δ0=1L\boldsymbol{\delta}^0=\boldsymbol{1}_L. alpha_s, beta_s, alpha_g, and beta_g are positive values. They are hyperparameters {αs\alpha_s, βs\beta_s, αg\alpha_g, βg\beta_g} that determines the shape of prior beta distribution for the slip and guessing parameters (default: NULL). When they are specified as NULL, they are set 11.

DINO model

The DINO model has the same model parameters and hyperparameters as the DINA model. We thus refer the readers to the DINA model.

MC-DINA model

The MC-DINA model has additional arguments delta_0 and a_0. a_0 corresponds to positive hyperparamters ajc0\mathbf{a}_{jc^\prime}^0 for all jj and cc^\prime. a_0 is by default set to NULL, and then it is specified as 11 for all elements.

Saturated DCM

The saturated DCM is a generalized model such as the G-DINA and GDM. In the saturated DCM, we have hyperparameters A0\mathbf{A}^0 and B0\mathbf{B}^0 in addition to δ0\boldsymbol{\delta}^0, which can be specified as arguments A_0 and B_0. They are specified by default as NULL, and then we set weakly informative priors.

HM-DCM

When model is specified as "hm_dcm", users have additional arguments nondecreasing_attribute, measurement_model, random_block_design, Test_versions, Test_order, random_start, A_0, B_0, delta_0, and omega_0. Users can accommodate the nondecreasing attribute constraint, which represents the assumption that mastered attributes are not forgotten, by setting the logical valued argument nondecreasing_attribute as TRUE (default: FALSE). Users can also control the measurement model by specifying measurement_model (default: "general"), and the current version can deal with the HM-general DCM ("general") and HM-DINA ("dina") models. This function can also handle the datasets collected by a random block design by specifying the logical valued argument random_block_design (default: FALSE). When it is specified as TRUE, users must enter Test_versions and Test_order. Test_versions is an argument indicating which version of the test each respondent has been assigned to based on a random block design, while Test_order indicates the sequence in which items are rearranged based on the random block design. A_0, B_0, delta_0, and omega_0 correspond to hyperparameters A0\mathbf{A}^0, B0\mathbf{B}^0, δ0\boldsymbol{\delta}^0, and Ω0\boldsymbol{\Omega}^0. Ω0\boldsymbol{\Omega}^0 is nonnegative hyperparameters of Dirichlet distributions for attribute transition probabilities. omega_0 is by default set to NULL, and then we set Ω0=1L1L\boldsymbol{\Omega}^0=\mathbf{1}_L\mathbf{1}_L^\top.

References

Yamaguchi, K., & Okada, K. (2020). Variational Bayes inference for the DINA model. Journal of Educational and Behavioral Statistics, 45(5), 569-597. doi:10.3102/1076998620911934

Yamaguchi, K. (2020). Variational Bayesian inference for the multiple-choice DINA model. Behaviormetrika, 47(1), 159-187. doi:10.1007/s41237-020-00104-w

Yamaguchi, K., Okada, K. (2020). Variational Bayes Inference Algorithm for the Saturated Diagnostic Classification Model. Psychometrika, 85(4), 973–995. doi:10.1007/s11336-020-09739-w

Yamaguchi, K., & Martinez, A. J. (2024). Variational Bayes inference for hidden Markov diagnostic classification models. British Journal of Mathematical and Statistical Psychology, 77(1), 55–79. doi:10.1111/bmsp.12308

Examples


# fit the DINA model
Q = sim_Q_J80K5
sim_data = dina_data_gen(Q=Q,I=200)
res = variationalDCM(X=sim_data$X, Q=Q, model="dina")
summary(res)




[Package variationalDCM version 2.0.1 Index]