predict.kqr | R Documentation |
kqr
object.Predict the fitted values for a kqr
object.
## S3 method for class 'kqr'
predict(object, x, newx = NULL, s = NULL, ...)
object |
A fitted |
x |
The predictor matrix, i.e., the |
newx |
A matrix of new values for |
s |
Value(s) of the penalty parameter 'lambda' at which predictions are required. Default is the entire sequence used to create the model. |
... |
Not used. |
The result is \beta_0 + K_i' \alpha
where \beta_0
and \alpha
are from the
kqr
object and K_i
is the ith row of the kernel matrix.
Returns the fitted values.
library(MASS)
data(GAGurine)
x <- as.matrix(GAGurine$Age)
y <- GAGurine$GAG
lambda <- 10^(seq(1, -4, length.out=30))
fit <- kqr(x, y, lambda=lambda, tau=0.1, is_exact=TRUE)
predict(fit, x, tail(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.