predict.hrq_glasso: Prediction for the hrq_glasso object

View source: R/hrq_glasso_predict.R

predict.hrq_glassoR Documentation

Prediction for the hrq_glasso object

Description

This function provides the prediction of the hrq_glasso object.

Usage

## S3 method for class 'hrq_glasso'
predict(object, newX, s = NULL, ...)

Arguments

object

The model object of hrq_glasso.

newX

New design matrix.

s

Value of lambda. Default is NULL, so that the function provides prediction at all lambdas used in hrq_glasso.

...

other input parameters.

Value

The function returns predicted values based on the fitted model from hrq_glasso.

Examples

n<- 100
p<- 10
x0<- matrix(rnorm(n*p),n,p)
X<- cbind(x0, x0^2, x0^3)[,order(rep(1:p,3))]
y<- -2+X[,1]+0.5*X[,2]-X[,3]-0.5*X[,7]+X[,8]-0.2*X[,9]+rt(n,2)
group<- rep(1:p, each=3)
fit<- hrq_glasso(X, y, group)
pred<- predict(fit, newX=X, s=0.3)

shaobo-li/hrqglas documentation built on March 9, 2023, 7:19 a.m.