Estimates lambda separately for each held-out split using only the remaining
labeled rows, then fits a final model. By default (final_fit_fn = fit_mixed_subjects_mml) the fold lambdas are averaged (weighted by fold size)
into a single scalar and the full sample is refit; pass final_fit_fn = fit_mixed_subjects_split to instead fit each fold's rows with its own
out-of-fold lambda.
Usage
tune_lambda_ability_risk_crossfit(
lambda_grid = seq(0, 1, by = 0.1),
observed,
predicted,
generated,
target_resp = NULL,
theta_true = NULL,
n_splits = 2,
split_id = NULL,
seed = NULL,
n_quad = 31,
initial_pars = NULL,
target_mode = c("fixed", "row_aligned"),
fit_fn = fit_mixed_subjects_mml,
final_fit_fn = fit_mixed_subjects_mml,
tuning_args = list(),
final_args = list(),
bounds = c(-6, 6),
control = list(maxit = 500),
...
)Arguments
- lambda_grid
Numeric vector of candidate lambda values in
[0, 1]. Formethod = "grid"these are the evaluated candidates; formethod = "optimize"onlyrange(lambda_grid)matters and bounds the search (e.g.lambda_grid = c(0, 0.8)caps lambda at 0.8). Defaults toseq(0, 1, by = 0.1).- observed, predicted, generated
Response matrices passed to
fit_mixed_subjects().- target_resp
Response matrix defining the target scoring population. If omitted,
observedis used.- theta_true
Optional true theta values for
target_resp, used in simulation studies to add squared scoring error to the risk. When omitted,mean_squared_errorin the summary isNA; onlymean_param_varis computed.- n_splits
Number of sample splits.
- split_id
Optional integer split assignment for labeled rows.
- seed
Optional seed used when
split_idis omitted.- n_quad
Number of quadrature nodes.
- initial_pars
Optional starting item parameters.
- target_mode
How
target_respis handled in each fold."fixed"(default): the fulltarget_respis used to evaluate risk in every fold, suitable when the target population is fixed and independent of the labeled-data split (e.g. an operational scoring population)."row_aligned": only the training rows oftarget_respare used, which is valid whentarget_resp = observedand fold-matched evaluation is desired.- fit_fn
Fitting function used for each fold's ability-risk tuning (passed to
tune_lambda_ability_risk()). Defaults tofit_mixed_subjects_mml()(marginal MML, recommended). The frozen expected-count estimatorfit_mixed_subjects()is still available but discouraged.- final_fit_fn
Function used to produce the final combined-data fit. Defaults to
fit_mixed_subjects_mml(), giving a scalar marginal-MML final fit: the fold-specific lambdas are averaged (weighted by fold size) into a single scalar and the full sample is refit. Passfit_mixed_subjects_split()to instead keep the per-foldlambdavector and fit each fold's rows with its own out-of-fold lambda — the textbook cross-fit decoupling, but it uses the discouraged frozen expected-count split estimator.- tuning_args
Named list of extra arguments forwarded only to the fold-level
tune_lambda_ability_risk()calls (and through them tofit_fn). For example,tuning_args = list(slope_upper = 4).- final_args
Named list of extra arguments forwarded only to
final_fit_fn. For example,final_args = list(mml_pred_weights = "own"). This keeps tuning-specific and final-fit-specific arguments cleanly separated, avoiding the earlier...leakage between the two.- bounds
Bounds passed to
score_theta().- control
Control list passed to
stats::optim().- ...
Deprecated; forwarded to
tuning_argsfor backward compatibility with a one-time message. Prefertuning_args/final_args.