This function performs parametric bootstrapping to estimate model risk. It fits a sequence
of Generalized Linear Models (GLMs) with different values of tau
, calculates the in-sample
prediction error, and incorporates deviations from the bootstrap response samples. The final
risk estimate is obtained by combining the in-sample error and the covariance penalty derived
from the bootstrap samples.
parametric_bootstrap(
formula,
cat_init,
tau_seq,
tau_0,
discrepancy_method,
parametric_bootstrap_iteration_times,
...
)
A numeric vector containing the risk estimates for each tau
in tau_seq
.
A formula specifying the GLMs. Should at least include response variables.
A list generated from cat_glm_initialization
.
A sequence of tuning parameter values (tau
) over which
the model risk will be estimated. Each tau
value is used to weight the synthetic data during model fitting.
A reference value for tau
used in the preliminary estimate model and variance calculation.
The method used to calculate the discrepancy (e.g., logistic deviance).
The number of bootstrap iterations to perform.
Other arguments passed to other internal functions.
Preliminary Estimate Model: The function first fits a GLM model using the observed
and synthetic data with an initial value of tau_0
for the synthetic data weights.
Bootstrap Samples: The function generates bootstrap response samples based on the mean and standard deviation of the preliminary estimate model, using parametric bootstrapping.
In-sample Prediction Error: For each value of tau
in tau_seq
, the function computes
the in-sample prediction error (e.g., using logistic deviance).
Bootstrap Models: For each bootstrap iteration, the function fits a GLM using the bootstrap response samples and calculates the corresponding lambda values.
Covariance Penalty: The function approximates the covariance penalty using the weighted deviations across all bootstrap iterations.
Final Risk Estimate: The final model risk estimate is calculated by summing the in-sample prediction error and the average weighted deviations from the bootstrap response samples.