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.2

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.2
File Size Uploaded Provenance Actions
dynamirt-0.2.2.tar.gz 5.7 MB Without provenance Details for dynamirt-0.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 5.8 MB

Release files / dynamirt-0.2.2.tar.gz

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

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

Download URL dynamirt-0.2.2-py3-none-any.whl
Size 45.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c68d90172aab1acf5b4a55a26744d5e9ba7e2567e5ba3d14585fdb84da513c8f
BLAKE2b-256 checksum
How to use checksums
ee0cd66389e8ab0aa652e74100c6ba6c5c0a2bceb961abf0db5bb5b6db8d1f5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Security for dynamirt 0.2.2

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