dynamirt 🧨
API for Bayesian item response modeling in particular and generalized linear latent variable models more generally. Additionally, the latent space can be parametrized in a composable fashion through built-ins like HSGPs as well as custom extensions that should make it an attractive choice for latent variable modeling in settings with correlated measurements such as longitudinal studies.
Installation
python -m pip install dynamirt
dynamirt requires Python 3.10 or newer.
Quickstart
Static 2-PL MIRT model
from dynamirt import Confirmatory, dynamirt, fit_mcmc
model = dynamirt(
model_type="2PL",
n_latent=2,
loadings=Confirmatory(Q, positive=Q),
)
covariates = {}
idata, mcmc = fit_mcmc(model, responses, covariates)
Longitudinal 2-PL MIRT model with HSGPs
from dynamirt import HSGP, Linear, Sparsity, dynamirt, fit_svi
covariates = {
"respondent_id": ...,
"time": ...,
}
intercept = Linear("respondent_mean", "one_", group_by="respondent_id")
trajectory = HSGP(
name="trajectory",
predictors="time",
group_by="respondent_id",
kernel="Matern",
ell=1.5, # assumes time is scaled and centered
m=30, # number of basis functions
nu=3 / 2, # smoothness of the Matern kernel
)
model = dynamirt(
model_type="2PL",
n_latent=2,
loadings=Sparsity(),
latent_fn=[intercept, trajectory],
)
idata, guide, svi_result = fit_svi(model, responses, covariates)
The API documentation is under development.
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
Metadata
Release files for dynamirt 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dynamirt-0.1.0.tar.gz | 537.2 kB | Without provenance | Details for dynamirt-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dynamirt-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for dynamirt-0.1.0-py3-none-any.whl |
Total release size: 564.4 kB
Release files / dynamirt-0.1.0.tar.gz
| Download URL | dynamirt-0.1.0.tar.gz |
|---|---|
| Size | 537.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38d51bdd07fd537f020663448b3c1d3a7fa01b550d35e443877155097271dae9
|
|
BLAKE2b-256 checksum How to use checksums |
71cdf3201d9fe025b104601c55406fe34707997c5c84ba0d6ca8acb4239985c1
|
| 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.1.0-py3-none-any.whl
| Download URL | dynamirt-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c782c9071e33412ed674eecb914b774c786b4512722f7e95fdb6e06debad21be
|
|
BLAKE2b-256 checksum How to use checksums |
1e08effa77483aca5512e161680d6056b2ae3e6948f8db3c4b1b822ab2daf466
|
| 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.1.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.