coef.kqr {fastkqr} | R Documentation |
Extract model coefficients from a 'kqr' object.
Description
Computes the coefficients at the requested value(s) for 'lambda' from a [kqr()] object.
Usage
## S3 method for class 'kqr'
coef(object, s = NULL, ...)
Arguments
object |
Fitted [kqr()] object. |
s |
Value(s) of the penalty parameter 'lambda' at which coefficients are required. Default is the entire sequence. |
... |
Not used. |
Details
'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.
Value
The coefficients at the requested values for 'lambda'.
See Also
[kqr()] and [predict.kqr()].
Examples
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)
[Package fastkqr version 1.0.0 Index]