GPCM#
- class pyfcirt.GPCM(
- *,
- priors: Mapping[str, TensorVariable] | None = None,
Generalized partial credit for ordered item responses.
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.
Returns#
- GPCM
A measurement declaration for
ItemInput(..., model=declaration). Pass the configured declaration as themodelvalue when loading a bundled dataset.
Notes#
Give ItemInput all allowed category codes in order. The first category
intercept is fixed at zero. Other category intercepts are estimated freely.
Default priors for active roles:
Prior role |
Default law |
|---|---|
|
LogNormal(mu=0.25, sigma=0.5) |
|
Normal(mu=0, sigma=1) |
Examples#
import pyfcirt as fc
declaration = fc.GPCM()
example = fc.load_example("simulated_mgpcm", model=declaration, n_persons=3)
prepared = fc.PreparedInputs.from_inputs(example.data)
print(fc.data_coverage(prepared).to_string())
n_items size n_persons n_answered n_missing
model_response_format
GPCM 12 1 3 36 0