Learn R Programming

midasml (version 0.0.6)

predict.reg_sgl: Computes prediction for the sg-LASSO linear regression

Description

Computes prediction for the sg-LASSO linear regression

Usage

# S3 method for reg_sgl
predict(object, newX, ...)

Arguments

object

fit object from sglassofit.

newX

matrix of out-of-sample covariate observations.

...

currently ignored optional parameters.

Value

a list of these variables:

pred - overall prediction.

predZ - intercept prediction.

predX - covariates prediction.

Examples

Run this code
# NOT RUN {
set.seed(1)
x <- matrix(rnorm(100 * 20), 100, 20)
y <- rnorm(100)
index <- 1:20
fit <- reg_sgl(X = x, y = y, index = index, gamma_w = 1, method_choice = "ic", 
       num_cores = 2, verbose = FALSE)
predict.reg_sgl(object = fit, newX = x)
# }

Run the code above in your browser using DataLab