mcmh_mc: MCMH Parameter Estimates for Multiple Chains

View source: R/mcmh_mc.R

mcmh_mcR Documentation

MCMH Parameter Estimates for Multiple Chains

Description

This function calculates MCMH parameter estimates for multiple chains. See documentation for mcmh_sc.R for more information.

Usage

mcmh_mc(
  chains = NULL,
  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
)

Arguments

chains

Number of chains in the MCMH sampler (scalar).

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.

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 (draws from every saved iteration of the MCMH sampler), omegaEAP (expected a posteriori estimates for omega), omegaPSD (posterior standard deviation estimates for omega), omega_psrf (potential scale reduction factor for omega), nuEAP (expected a posteriori estimates for nu), nuPSD (posterior standard deviation estimates for nu), nu_psrf (potential scale reduction factor for nu), zetaEAP (expected a posteriori estimates for zeta), zetaPSD (posterior standard deviation estimates for zeta), zeta_psrf (potential scale reduction factor for zeta).

Examples

mcmh_mc(chains = 3, 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)


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