Choice of the penalty parameter for a PolyMARS model
This function fits a PolyMARS model for different values of the penalty parameter and compute criteria.
penaltyPolyMARS(X,Y,test=NULL,graphic=FALSE,K=10, Penalty=seq(0,5,by=0.2))
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 |
A data frame containing
a |
the values of the penalty parameter |
R2 |
the |
m |
the size of the selected model |
If a test set is available the last row is
R2test |
the |
If no test set is available, criteria computed by K-corss-validation are provided:
Q2 |
the |
RMSE CV |
|
Note that the penalty parameter could be chosen by minimizing the value of the RMSE
by cross-validation.
D. Dupuy
modelFit
, R2
and crossValidation
data(dataIRSN5D) X <- dataIRSN5D[,1:5] Y <- dataIRSN5D[,6] data(testIRSN5D) library(polspline) Crit <- penaltyPolyMARS(X,Y,test=testIRSN5D[,-7],graphic=TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.