powered by
This function computes the residuals, given the optimal values for lambda and the locations of the knots.
# S3 method for freekt residuals(object, …)
An object of class "freekt" obtained by using one of the fitting algorithms.
freekt
Additional arguments to be passed to residuals.freekt. Currently ignored.
A vector containing the residuals.
fitted.freekt to compute the fitted values.
fitted.freekt
# NOT RUN { x <- 0:30/30 truey <- x*sin(10*x) set.seed(10556) y <- truey + rnorm(31, 0, 0.2) xy.freekt <- freelsgen(x, y, degree = 2, numknot = 2, 555) plot(x, residuals(xy.freekt)) # }
Run the code above in your browser using DataLab