Estimate MUPP person parameters given item responses, item parameters, and item properties.
a data.frame of (at least) [person, item, resp]
a data.frame of (at least) [item, statement, dim, alpha, delta, tau]
the estimation method ("bfgs", "MCMC")
a list of parameters to control the algorithm. See details.
other parameters to pass to the method
a list of [estimates, vars, hessian, loglik, iters]
for MLE estimation
or [estimates, sds]
for MCMC estimation
Method BFGS uses a modified BFGS algorithm, based on Li and Fukushima (2001), which includes modifications of the BFGS estimated hessian with demonstrated global convergence properties.
For BFGS, control parameters include
convergence criterion, will converge if length of gradient is shorter than this value. Defaults to 1e-07.
maximum number of iterations before convergence. Defaults to 100.
number of random starts at different theta vectors (using latin hypercube samples. Defaults to 4.)
For MCMC, control parameters include
total number of iterations.
number of iterations to throw away when calculating summary statistics.
the standard deviation of the step size for subsequent Metropolis-Hastings draws.
Li & Dong-Hui (2001). A modified BFGS method and its global convergence in nonconvex minimization. Journal of Computational and Applied Mathematics, 129, 15-35.
optimumLHS
if (FALSE) {
set.seed(23523)
# simulate parameters and responses to the model
# (assumption is that params/resp will follow conventions)
params <- simulate_mupp_params(n_persons = 10,
n_items = 300,
n_dims = 9,
max_item_dims = 2,
unidim_items = TRUE)
resp <- do.call(simulate_mupp_resp,
params)
# thetas for comparison
thetas <- tidyr::spread(params$persons,
key = "dim",
value = "theta")[ , -1]
# estimating thetas using BFGS algorithm (one start for comparison purposes)
est_thetas_mle <- estimate_mupp_thetas(resp = resp$resp,
items = params$items,
method = "bfgs",
control = list(n_starts = 1))
# correlating (super high correlations!)
diag(cor(thetas, est_thetas_mle$estimates))
# estimating thetas using MCMC algorithm
est_thetas_mcmc <- estimate_mupp_thetas(resp = resp$resp,
items = params$items,
method = "mcmc",
control = list(n_iters = 1000,
n_burnin = 500))
# correlating with MLE thetas (even higher correlations!)
diag(cor(est_thetas_mle$estimates, est_thetas_mcmc$estimates))
}