Skip to main content

dynamirt

dynamirt is a Python/NumPyro package for Bayesian static and longitudinal multidimensional item response theory (MIRT). It provides an interface to the most common IRT measurement models and lets you freely specify the functional form of the latent construct. The built-ins (Gaussian processes (GPs) and Hilbert space approximations (HSGPs)) make it geared toward repeated binary or ordinal item responses collected at irregular times, including ragged panel and ecological momentary assessment (EMA) data where respondents have different numbers and schedules of observations.

Item Response Pattern Latent Trajectories

Installation

dynamirt requires Python 3.10 or newer.

python -m pip install dynamirt

If you want to use dynamirt on GPU you need to install it into an environment with GPU-enabled JAX. Otherwise, the default CPU-only JAX will be installed.

Documentation

https://dynamirt.readthedocs.io/

Building a model

dynamirt() builds a NumPyro model from a measurement model and an optional combination of latent terms. It returns a model callable, which you fit with fit_mcmc or fit_svi:

A Static Unidimensional IRT model

from dynamirt import dynamirt, fit_mcmc

model = dynamirt(model_type="2PL")
fit = fit_mcmc(model, responses)
idata = fit.to_idata()

A Longitudinal IRT Model using HSGPs

from dynamirt import dynamirt, HSGP, fit_mcmc

model = dynamirt(
    model_type="2PL",
    latent_terms=[
        HSGP("trajectory", predictors="time", group_by="respondent",
             kernel="Matern", ell=1.5, m=30),
    ],
    index_sizes={"respondent": n_respondents},
)

fit = fit_mcmc(model, responses, {"time": time, "respondent": respondent_ids})
idata = fit.to_idata()

Please note that dynamirt is work in progress and there might be minor breaking API changes before a 1.0 release.

Supported measurement models

model_type Response Model
"1PL" Binary Rasch model (loadings fixed to 1)
"2PL" Binary Item intercepts and loadings
"3PL" Binary 2PL with a lower asymptote (guessing)
"4PL" Binary 3PL with an upper asymptote (slipping)
"GRM" Ordinal Graded response model
"PCM" Ordinal Partial credit model (loadings fixed to 1)
"GPCM" Ordinal Generalized partial credit model

Built with

Other IRT and latent variable software

R

  • mirt — Multidimensional item response theory in R
  • emIRT — EM Algorithms for Estimating Item Response Theory Models (including ideal point estimation over time)
  • gllvm — Generalized linear latent variable models
  • Hmsc — Hierarchical Modelling of Species Communities

Python

  • py-irt — A Scalable Item Response Theory Library for Python
  • girth — A python package for estimating item response theory (IRT) parameters

Metadata

Release files for dynamirt 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dynamirt 0.2.0
File Size Uploaded Provenance Actions
dynamirt-0.2.0.tar.gz 5.7 MB Without provenance Details for dynamirt-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dynamirt 0.2.0
File Interpreter ABI Platform Actions
dynamirt-0.2.0-py3-none-any.whl Python 3 none any Details for dynamirt-0.2.0-py3-none-any.whl

Total release size: 5.8 MB

Release files / dynamirt-0.2.0.tar.gz

Download URL dynamirt-0.2.0.tar.gz
Size 5.7 MB
Tags Source
SHA-256 checksum
How to use checksums
c054578ecd591d6b67f3aba5fd5d5609d9b89a3fc5e640d384387862e50e6827
BLAKE2b-256 checksum
How to use checksums
ad79b6a53cb627237c4092d2b104f7a52ca1ae6f0f9a37dcf1a21255aeefa47c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / dynamirt-0.2.0-py3-none-any.whl

Download URL dynamirt-0.2.0-py3-none-any.whl
Size 41.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76fa63e769ae0152b0309e0149b1854c3efaeb0f1c98779acddf0f023c57f9ef
BLAKE2b-256 checksum
How to use checksums
491a26f95d6eb70a29e0fe2a056b614007c1de8ce284bdaabd52da4cde9ae461
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for dynamirt 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page