validate.regRSM: Selects the new final model from existing 'regRSM' object.

Description Usage Arguments Details Value Author(s) Examples

Description

This function selects the new final model based on the previously computed final scores.

Usage

1
2
## S3 method for class 'regRSM'
validate(object, yval, xval)

Arguments

object

Fitted 'regRSM' model object.

yval

Quantitative response vector from validation set.

xval

Input matrix from validation set.

Details

To use the function, the argument store_data in the 'regRSM' object must be TRUE. The function uses final scores from 'regRSM' object to create a ranking of variables. Then the final model which minimizes the prediction error on specified validation set is chosen. Object of class 'regRSM' is returned. The final scores in the original 'regRSM' object and in the new one coincide. However the final models can be different.

Value

Object of class 'regRSM' is returned.

Author(s)

Pawel Teisseyre, Robert A. Klopotek.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
p=100
n=100
beta1 = numeric(p)
beta1[c(1,5,10)]=c(1,1,1)  
x = matrix(0,ncol=p,nrow=n)
xval = matrix(0,ncol=p,nrow=n)
for(j in 1:p){ 
    x[,j]=rnorm(n,0,1)
    xval[,j]=rnorm(n,0,1)  
}
y = x %*% beta1 + rnorm(n)
yval = xval %*% beta1 + rnorm(n)

p1 = regRSM(x,y,store_data=TRUE)
p2 = validate(p1,yval,xval)

regRSM documentation built on May 2, 2019, 7:01 a.m.