predict.nckqr {fastkqr}R Documentation

Predict the fitted values for a nckqr object.

Description

Predict the fitted values for a nckqr object.

Usage

## S3 method for class 'nckqr'
predict(object, x, newx = NULL, s2, s1 = NULL, ...)

Arguments

object

A fitted nckqr object.

x

The predictor matrix, i.e., the x matrix used when fitting the nckqr object.

newx

A matrix of new values for x at which predictions are to be made. Note that newx must be of a matrix form, predict function does not accept a vector or other formats of newx.

s2

Value of the penalty parameter 'lambda2' at which predictions are required.

s1

Value(s) of the penalty parameter 'lambda1' at which predictions are required. Default is the entire sequence used to create the model.

...

Not used.

Value

Returns the fitted values for the non-crossing kernel quantile regression model.

Examples

library(MASS)
data(GAGurine)
x <- as.matrix(GAGurine$Age)
y <- GAGurine$GAG
l2 <- 1e-4
ttau <- c(0.1, 0.3, 0.5, 0.7, 0.9)
l1_list <- 10^seq(-8, 2, length.out=10)
fit <- nckqr(x,y, lambda1=l1_list, lambda2=l2, tau=ttau)
predict(fit, x, tail(x), s1=l1_list[1:3], s2=1e-4)

[Package fastkqr version 1.0.0 Index]