predict.cv.mcen: Makes predictions from the model with the smallest...

View source: R/mcen.r

predict.cv.mcenR Documentation

Makes predictions from the model with the smallest cross-validation error.

Description

Makes predictions from the model with the smallest cross-validation error.

Usage

## S3 method for class 'cv.mcen'
predict(object, newx, ...)

Arguments

object

The cv.mcen object.

newx

The X matrix of predictors.

...

Additional parameters to be sent to predict.

Value

Returns the predicted values from the model with the smallest cross-validation error.

Author(s)

Ben Sherwood <ben.sherwood@ku.edu>, Brad Price <brad.price@mail.wvu.edu>

Examples


x <- matrix(rnorm(400),ncol=4)
beta <- beta <- matrix(c(1,1,0,0,0,0,-1,-1,0,0,-1,-1,1,1,0,0),ncol=4)
y <- x%*%beta + rnorm(400) 
mcen_fit <- cv.mcen(x,y,ky=2,gamma_y=3)
new_x <- matrix(rnorm(12),ncol=4)
mcen_preds <- predict(mcen_fit, new_x)


mcen documentation built on April 1, 2023, 12:11 a.m.

Related to predict.cv.mcen in mcen...