cvpredRisk {cvmaPLFAM} | R Documentation |
Output the prediction risks of the cross-validation model averaging (CVMA) method for partial linear functional additive models (PLFAMs)
Description
Calculate the estimated weights for averaging across all candidate models and the corresponding mean squared prediction error risk.
Usage
cvpredRisk(
M,
nump,
numq,
a2,
a3,
nfolds,
X.train,
ZZ.train,
Y.train,
X.pred,
ZZ.pred,
Y.pred,
nbasis,
tt
)
Arguments
M |
The number of candidate models. |
nump |
The number of scalar predictors in candidate models. |
numq |
The number of funtional principal components (FPCs) in candidate models. |
a2 |
The number of FPCs in each candidate model. See |
a3 |
The index for each component in each candidate model. See |
nfolds |
The number of folds used in cross-validation. |
X.train |
The training data of scalar predictors. |
ZZ.train |
The training data of the functional predictor. |
Y.train |
The training data of response variable. |
X.pred |
The test data of scalar predictors. |
ZZ.pred |
The test data of the functional predictor. |
Y.pred |
The test data of response variable. |
nbasis |
The number of basis functions used for spline approximation. |
tt |
The vector of recording/measurement points for the functional predictor. |
Value
A list
of
cv |
Mean squared error risk in training data set, produced by CVMA method. |
ws |
A |
predcv |
Mean squared prediction error risk in test data set, produced by CVMA method. |