anvala: A GPU-Accelerated Python Library for Latent Variable and Network Psychometrics

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.

Authors

Publication Details

Journal
PsyArXiv (OSF Preprints)
Published
2026-11-27
DOI
https://doi.org/10.31234/osf.io/jqfrw_v1
Primary Topic
Psychometric Methodologies and Testing
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

anvala: A GPU-Accelerated Python Library for Latent Variable and Network Psychometrics

Frederico Gonçalves Pedrosa
PsyArXiv (OSF Preprints)
Psychometric Methodologies and Testing
preprint

anvala: A GPU-Accelerated Python Library for Latent Variable and Network Psychometrics

Frederico Gonçalves Pedrosa
preprint en

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.

PsyArXiv (OSF Preprints)
Psychometric Methodologies and Testing
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
anvala: A GPU-Accelerated Python Library for Latent Variable and Network Psychometrics — Frederico Gonçalves Pedrosa · PsyArXiv (OSF Preprints) (2026) | TGRS Research Map | TGRS