lvmcomp is a R package for analyzing large scale latent variable models with efficient parallel algorithms. It employs stochastic EM algorithms for latent variable models with a high-dimensional latent space. So far, we provide functions for confirmatory item factor analysis based on the multidimensional two parameter logistic (M2PL) model and the generalized multidimensional partial credit model. These functions scale well for problems with many latent traits (e.g., thirty or even more) and are virtually tuning-free. The computation is facilitated by multiprocessing 'OpenMP’ API.

Major Features

  • Use an improved Stochastic EM algorithm to solve generalized partial credit model (M2PL as a special case)

  • Efficient sampler employs a tailored adaptive rejection sampling algorithm

  • Written in R with core functions implemented in C++

  • OpenMP C++ parallel API is employed for speeding up the algorithm using modern multi-core CPUs.


lvmcomp package has been published on CRAN. Install it simply by running the following command in R console.

> install.packages(“lvmcomp”)

Source code can be found on lvmcomp's GitHub page.


  1. Zhang, S. , Chen, Y. and Liu, Y. (2018), An improved stochastic EM algorithm for large‐scale full‐information item factor analysis. Br J Math Stat Psychol. <doi:10.1111/bmsp.12153>