parametric_bootstrap | R Documentation |
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,
...
)
formula |
A formula specifying the GLMs. Should at least include response variables. |
cat_init |
A list generated from |
tau_seq |
A sequence of tuning parameter values ( |
tau_0 |
A reference value for |
discrepancy_method |
The method used to calculate the discrepancy (e.g., logistic deviance). |
parametric_bootstrap_iteration_times |
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.
A numeric vector containing the risk estimates for each tau
in tau_seq
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.