mcmh_sc: MCMH Parameter Estimates for Single Chain

View source: R/mcmh_sc.R

mcmh_scR Documentation

MCMH Parameter Estimates for Single Chain

Description

This function calculates MCMH parameter estimates for a single chain. The MCMH method implemented follows Patz and Junker (1999). The approach to tuning the scale and covariance matrix follows BDA and SAS 9.2 User Guide, 2nd Ed. "The MCMC Procedure: Tuning the Proposal Distribution".

Usage

mcmh_sc(
  y = y,
  obj_fun = NULL,
  est_omega = TRUE,
  est_nu = TRUE,
  est_zeta = TRUE,
  lambda = NULL,
  kappa = NULL,
  gamma = NULL,
  omega0 = NULL,
  nu0 = NULL,
  zeta0 = NULL,
  omega_mu = NULL,
  omega_sigma2 = NULL,
  nu_mu = NULL,
  nu_sigma2 = NULL,
  zeta_mu = NULL,
  zeta_sigma2 = NULL,
  burn = NULL,
  thin = NULL,
  min_tune = NULL,
  tune_int = NULL,
  max_tune = NULL,
  niter = NULL,
  weight = 1,
  verbose_mcmh = F
)

Arguments

y

Matrix of item responses (K by IJ).

obj_fun

A function that calculates predictions and log-likelihood values for the selected model (character).

est_omega

Determines whether omega is estimated (logical).

est_nu

Determines whether nu is estimated (logical).

est_zeta

Determines whether zeta is estimated (logical).

lambda

Matrix of item structure parameters (IJ by JM).

kappa

Matrix of item guessing parameters (K by IJ).

gamma

Matrix of experimental structure parameters (JM by MN).

omega0

Starting values for omega.

nu0

Starting values for nu.

zeta0

Starting values for zeta.

omega_mu

Vector of means prior for omega (1 by MN).

nu_mu

Prior mean for nu (scalar).

zeta_mu

Vector of means prior for zeta (1 by JM).

burn

Number of iterations at the beginning of an MCMC run to discard (scalar).

thin

Determines every nth observation retained (scalar).

min_tune

Determines when tunning begins (scalar).

tune_int

MCMH tuning interval (scalar).

max_tune

Determines when tunning ends (scalar).

niter

Number of iterations of the MCMH sampler.

weight

Determines the weight of old versus new covariance matrix.

verbose_mcmh

Print progress of MCMH sampler.

omega_sigma

Covariance matrix prior for omega (MN by MN).

zeta_sigma@

Covariance matrix prior for zeta (JM by JM).

nu_sigma@

Prior variance for nu (scalar).

Value

List with elements omega_draws (list of (niter - burn) / thin draws for K by MN omega matrix), nu_draws (list of (niter - burn) / thin draws for K by IJ nu matrix), zeta_draws (list of (niter - burn) / thin draws for K by JM zeta matrix), cand_o_var (list of K final MN by MN candidate proposal covariance matrices for omega for each examinee), cand_n_var (list of IJ final scalar candidate proposal variances for nu for all items), cand_z_var (list of final JM by JM candidate proposal covariance matrices for zeta for all examinees)

References

Patz, R. J., & Junker, B. W. (1999). A Straightforward Approach to Markov Chain Monte Carlo Methods for Item Response Models. Journal of Educational and Behavioral Statistics, 24(2), 146.

Examples

mcmh_sc(y = sdirt$y, obj_fun = dich_response_model, est_omega = TRUE,
    est_nu = TRUE, est_zeta = TRUE, lambda = sdirt$lambda, kappa = sdirt$kappa,
    gamma = sdirt$gamma, omega0 = array(data = 0, dim = dim(sdirt$omega)),
    nu0 = array(data = 0, dim = c(ncol(sdirt$nu), 1)),
    zeta0 = array(data = 0, dim = dim(sdirt$zeta)),
    omega_mu = sdirt$omega_mu, omega_sigma2 = sdirt$omega_sigma2,
    nu_mu = matrix(sdirt$nu_mu), nu_sigma2 = matrix(sdirt$nu_sigma2),
    zeta_mu = sdirt$zeta_mu, zeta_sigma2 = sdirt$zeta_sigma2,
    burn = 0, thin = 10, min_tune = 50, tune_int = 50, max_tune = 1000,
    niter = 2000, weight = 1/1, verbose_mcmh = TRUE)


mlthom/CogIRT documentation built on June 13, 2022, 7:45 a.m.