TIRT#
- class pyfcirt.TIRT(
- *,
- priors: Mapping[str, TensorVariable] | None = None,
- link: Literal['probit', 'logit', 'beta_probit', 'beta_logit'] = 'probit',
- residuals: Literal['estimated', 'fixed'] = 'estimated',
- statement_effect_parameterization: Literal['centered', 'noncentered'] = 'noncentered',
- loading_anchors: Mapping | None = None,
Linear statement utilities for pair comparisons.
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.link: {“probit”, “logit”, “beta_probit”, “beta_logit”}Default:
"probit". The discrete logit multiplies the standardized predictor by 1.702. Beta links require a separate pair judgment, aUnitIntervalScaleand an explicit positiveresponse_precisionprior.residuals: {“estimated”, “fixed”}Estimate eligible statement residual variances (default), or fix them to 0.5.
statement_effect_parameterization: {“centered”, “noncentered”}Parameterization of discrete statement effects. Default:
"noncentered".loading_anchors: mapping or NoneStatement IDs and positive fixed loadings.
Noneuses design and automatic references.
Returns#
- TIRT
A measurement declaration for
FCInput(..., model=declaration). Pass the configured declaration as themodelvalue when loading a bundled dataset.
Notes#
Binary and graded pairs have one likelihood factor per comparison. For comparisons derived from a ranking, the product is a composite likelihood. Estimated statement effects are scaled by the statement residual standard deviation.
Default priors for active roles:
Prior role |
Default law |
|---|---|
|
LogNormal(mu=0, sigma=0.5) |
|
Normal(mu=0, sigma=1) |
|
HalfNormal(loc=0, scale=1) |
|
Normal(mu=0, sigma=1) |
Examples#
import pyfcirt as fc
declaration = fc.TIRT(link="logit", residuals="fixed")
example = fc.load_example("tirt_study", model=declaration, n_persons=3)
prepared = fc.PreparedInputs.from_inputs(example.data)
print(fc.data_coverage(prepared).to_string())
n_blocks size n_persons n_answered n_missing
model_response_format
TIRT 24 3 3 72 0