This function calculate the expectation of the residuals by the use of the Frisch–Waugh–Lovell theorem.
Arguments
- dat
Dataframe/List. List contains variable
x
andz
.- a
Numeric. Default is
a = self$prm$a
.- b
Numeric. Default is
b = self$prm$b
.- c
Numeric. Default is
c = self$prm$c
.
Examples
mod <- quartic_model(-1, 1, 1, 0.5)
dat <- mod$gen(1000, fit_model = TRUE)
dat$exp <- mod$E(dat)
mod$plot(dat) + ggplot2::geom_point(ggplot2::aes(.fitted, exp),
col = "red",
alpha = 0.6)