Skip to contents

This default method gets bootstrapped residuals from a fitted linear model by sampling the observations with replacement then refit the model. User needs to override this method if a different bootstrapping scheme is needed.

Usage

AUTO_VI$boot_method(
  fitted_model = self$fitted_model,
  data = self$get_data()
)

Arguments

fitted_model

lm. A linear model object.

data

Data frame. The data used to fit the model. See also AUTO_VI$get_data().

Value

A tibble with two columns .fitted and .resid.

Examples


my_vi <- auto_vi(fitted_model = lm(speed ~ dist, data = cars))
null_resid <- my_vi$boot_method()
my_vi$plot_resid(null_resid)