DichotomousIRT#
- class pyfcirt.DichotomousIRT(
- *,
- priors: Mapping[str, TensorVariable] | None = None,
- kind: Literal['1PL', '2PL', '3PL', '4PL'] = '2PL',
Binary 1PL–4PL models with a logistic response curve.
Parameters#
priors: mapping or NoneOverride local prior roles with unnamed PyMC distributions such as
pm.Normal.dist(mu=0, sigma=1).Noneuses the defaults below.kind: {“1PL”, “2PL”, “3PL”, “4PL”}Model type. Default:
"2PL". 1PL estimates one common loading. 1PL and 2PL fix asymptotes to 0 and 1; 3PL estimates the lower asymptote; 4PL estimates both.
Returns#
- DichotomousIRT
A measurement declaration for
ItemInput(..., model=declaration). Pass the configured declaration as themodelvalue when loading a bundled dataset.
Notes#
Use two consecutive categories in the item declaration. In 4PL the upper asymptote’s Beta base prior is truncated above the corresponding lower value. Custom 1PL priors can relax the default positive loading convention.
Default priors for active roles:
Prior role |
Default law |
|---|---|
|
LogNormal(mu=0.25, sigma=0.5) |
|
Normal(mu=0, sigma=1) |
|
Beta(alpha=1, beta=4) |
|
Beta(alpha=4, beta=1) |
Examples#
The eight items share one discrimination in this 1PL declaration.
import pyfcirt as fc
declaration = fc.DichotomousIRT(kind="1PL")
example = fc.load_example("simulated_mirt", model=declaration, n_persons=3)
prepared = fc.PreparedInputs.from_inputs(example.data)
print(prepared.constant_data.sizes["loading_id"])
1