RegressionOptions#
- class pyfcirt.RegressionOptions#
Specify keyword options for the string form of Model.add_regressions().
Parameters#
priors: mapping or NoneNative coefficient priors by term, including
"Intercept"and slope fallback"common".parameter_residual_sd: positive float, PyMC RV or NoneRemaining measurement-parameter SD.
Noneuses the target default.center_predictors: boolCenter numeric predictors. Default when omitted:
True.standardize_predictors: boolDivide numeric predictors by their training SDs. Default:
False.coefficient_noncentered: boolNoncenter the coefficients. Default:
False.deviation_noncentered: bool or NoneParameterization of remaining measurement deviations.
Noneleaves the target default.
Returns#
- dict
A typed options mapping. Pass it under the target key in
Model.add_regressions(..., options=...). Omitted keys leave their defaults.
Examples#
Standardize the training predictor for a theta formula.
import pandas as pd
import pyfcirt as fc
bundle = fc.load_example("simulated_mirt", model="DichotomousIRT", n_persons=4)
ids = bundle.data.responses.frame["person_id"].drop_duplicates().tolist()
people = pd.DataFrame({"person_id": ids, "study_hours": [1.0, 3.0, 2.0, 6.0]})
model = fc.Model(bundle.data)
options = fc.RegressionOptions(standardize_predictors=True)
model.add_regressions(
"theta ~ study_hours",
person_data=people,
options={"theta": options},
)
print(model.prepared.coords["theta_predictor"].tolist())
['study_hours']
See also#
Regression for the same options with an explicit feature table.