Last data update: 2014.03.03

R: Choice of the penalty parameter for a PolyMARS model
penaltyPolyMARSR Documentation

Choice of the penalty parameter for a PolyMARS model

Description

This function fits a PolyMARS model for different values of the penalty parameter and compute criteria.

Usage

penaltyPolyMARS(X,Y,test=NULL,graphic=FALSE,K=10,
		Penalty=seq(0,5,by=0.2))

Arguments

X

a data.frame containing the design of experiments

Y

a vector containing the response variable

test

a data.frame containing the design and the response of a test set when available, the prediction criteria will be computed for the test data (default corresponds to no test set)

graphic

if TRUE the values of the criteria are represented

K

the number of folds for cross-validation (by default, K=10)

Penalty

a vector containing the values of the penalty parameter

Value

A data frame containing

a

the values of the penalty parameter

R2

the R2 criterion evaluted on the learning set

m

the size of the selected model

If a test set is available the last row is

R2test

the R2 criterion evaluated on the test set

If no test set is available, criteria computed by K-corss-validation are provided:

Q2

the Q2 evaluated by cross-validation (by default, K=10)

RMSE CV

RMSE computed by cross-validation

Note that the penalty parameter could be chosen by minimizing the value of the RMSE by cross-validation.

Author(s)

D. Dupuy

See Also

modelFit, R2 and crossValidation

Examples

data(dataIRSN5D)
X	<- dataIRSN5D[,1:5]
Y	<- dataIRSN5D[,6]
data(testIRSN5D)
library(polspline)
Crit	<- penaltyPolyMARS(X,Y,test=testIRSN5D[,-7],graphic=TRUE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DiceEval)
Loading required package: DiceKriging
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DiceEval/penaltyPolyMARS.Rd_%03d_medium.png", width=480, height=480)
> ### Name: penaltyPolyMARS
> ### Title: Choice of the penalty parameter for a PolyMARS model
> ### Aliases: penaltyPolyMARS
> ### Keywords: models
> 
> ### ** Examples
> 
> data(dataIRSN5D)
> X	<- dataIRSN5D[,1:5]
> Y	<- dataIRSN5D[,6]
> data(testIRSN5D)
> library(polspline)
> Crit	<- penaltyPolyMARS(X,Y,test=testIRSN5D[,-7],graphic=TRUE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>