[Experimental]

Estimate MUPP statement and person parameters given item responses and item properties using MCMC

estimate_mupp_params(resp, items, method = "MCMC", control = list(), ...)

Arguments

resp

a data.frame of (at least) [person, item, resp]

items

a data.frame of (at least) [item, statement, dim]

method

the estimation method (MCMC is the only one that works now)

control

a list of parameters to control the algorithm. See details.

...

other parameters to pass to the estimation algorithm. See details.

Value

a list of [theta, params] arrays with the third dimension indicating the iteration as well as means and sds

Details

  • For MCMC, additional parameters include

    initial_params

    a named list with names indicating the parameter and values indicating the starting values/initial parameter estimates

    fixed_params

    a character vector with elements that are fixed to their initial parameters for the entire estimation algorithm

  • For MCMC, control parameters include

    n_iters

    total number of iterations.

    n_burnin

    number of iterations to throw away when calculating summary statistics.

    step_size_sd

    the standard deviation of the step size for subsequent Metropolis-Hastings draws.

Author

Steven Nydick, steven.nydick@kornferry.com

Examples

if (FALSE) {
set.seed(3452345)

# simulate parameters and responses to the model
# (assumption is that params/resp will follow conventions)
params <- simulate_mupp_params(n_persons     = 100,
                               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]
items  <- params$items

# estimating thetas using algorithm (one start for comparison purposes)
est_params  <- estimate_mupp_params(resp    = resp$resp,
                                    items   = resp$items,
                                    method  = "MCMC",
                                    control = list(n_iters  = 1000,
                                                   n_burnin = 500),
                                    initial_params = list(delta = sign(items$delta)))

# correlating (not great, but small iters and few people)
diag(cor(thetas, est_params$means$thetas))
cor(items$alpha, est_params$means$alpha)
cor(items$delta, est_params$means$delta)
cor(items$tau,   est_params$mean$tau)
}