coef.kqr | R Documentation |
Computes the coefficients at the requested value(s) for 'lambda' from a [kqr()] object.
## S3 method for class 'kqr'
coef(object, s = NULL, ...)
object |
Fitted [kqr()] object. |
s |
Value(s) of the penalty parameter 'lambda' at which coefficients are required. Default is the entire sequence. |
... |
Not used. |
's' is the new vector of 'lambda' values at which predictions are requested. If 's' is not in the lambda sequence used for fitting the model, the 'coef' function will use linear interpolation to make predictions. The new values are interpolated using a fraction of coefficients from both left and right 'lambda' indices.
The coefficients at the requested values for 'lambda'.
[kqr()] and [predict.kqr()].
library(MASS)
data(GAGurine)
x <- as.matrix(GAGurine$Age)
y <- GAGurine$GAG
lambda <- 10^(seq(1, -4, length.out=10))
fit <- kqr(x, y, lambda=lambda, tau=0.1)
coef(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.