anvala: A GPU-Accelerated Python Library for Latent Variable and Network Psychometrics
Year: 2026
Type: preprint
Abstract: Applied psychometric modeling has long centered on R packages such as lavaan, semTools, and EGAnet. By contrast, contemporary computational and generative psychometrics, which relieson large language models and dense text embeddings executed through tensor operations, runs predominantly in Python. Passing data and model specifications back and forth between the twoenvironments adds serialization overhead and makes reproducible pipelines harder to maintain. At the same time, resampling-intensive methods such as bias-corrected and accelerated (BCa)bootstrapping and bootstrap Exploratory Graph Analysis (boot_ega) remain slow when executed sequentially on standard processors. Here, I introduce anvala (v0.1.0), an open-source Pythonlibrary built on PyTorch that matches the numerical output of established R psychometric packages while using graphics processing unit (GPU) tensor parallelization to accelerate resampling. Adopting lavaan-compatible model syntax and double-precision (float64) automatic differentiation, anvala supports continuous (ML, MLR) and ordinal (WLSMV) structural equation modeling, multigroup measurement invariance testing with partial invariance and Lagrange multiplier score tests, bifactor reliability indices, and network psychometrics (EGA, Unique Variable Analysis, and entropy fit indices). On canonical benchmark datasets, anvala reproduces R reference parameter estimates, robust standard errors, scaled fit indices, and network structures within 10−16 to 10−5 across factor, ordinal, multi-group, bifactor, and network models, and within 1.10 × 10−4 on the small-sample full SEM. Three simulation studies then map the CPU–GPU performance crossover across model dimensionalities (p ∈ [3, 60]) and confirm 100% convergence, low parameter bias (< 5%), wellcalibrated interval coverage, and accurate latent mean recovery under partial invariance.
Source: PsyArXiv (OSF Preprints)
Author: Frederico Gonçalves Pedrosa
Language: English
Field: Decision Sciences
Domain: Social Sciences
Open Access status: green
OpenAlex ID: W7240255138
Cites:
Cited by:
Related to:
