Learn R Programming

mirt (version 0.8.0)

calcLogLik: Monte Carlo Log-Likelihood Calculation

Description

Calculates a new object that contain the Monte Carlo estimated observed log-likelihood values for mirt objects estimated with the MH-RM algorithm

Arguments

object
a model of class ConfirmatoryClass or ExploratoryClass
draws
the number of Monte Carlo draws
G2
logical; estimate the G2 model fit statistic?
cl
a cluster object from the parallel package (set from using makeCluster(ncores))
...
parameters that are passed

Value

  • Returns an object with the log-likelihood and Monte Carlo standard errors, and (possibly) the G^2 and other model fit statistic if there is no missing data.

See Also

confmirt, multipleGroup

Examples

Run this code
# no parallel
mod1withLogLik <- calcLogLik(mod1, draws=5000)

#with parallel using detected number of cores
#note: can also be directly passed as an argument to confmirt, multipleGroup, or mixemirt
library(parallel)
cl <- makeCluster(detectCores())
mod1withLogLik <- calcLogLik(mod1, draws=5000, cl=cl)

Run the code above in your browser using DataLab