Calc_fold_CV_Error: Apply Parameter Tuning

Description Usage Arguments Value

Description

For each fold in the cross validation, calls Get_CVWeights to split into training and validation data and get weights, then applies Calculate_CV_Error over all candidate values for alpha. Returns array of dimensions 6 by 3 by length(parvec) containing errors. Dimensions index (1) type of error calculated 1-MSE without downweighting outliers in CV error 2-MAPE without downweighting outliers in CV error 3-MSE downweighting outliers according to BisqwtRF 4-MAPE downweighting outliers according to BisqwtRF 5-MSE downweighting outliers according to BisqwtRFL 6-MAPE downweighting outliers according to BisqwtRFL (2) applied to all cases in TRAIN2, outliers only, nonoutliers only (3) index of alpha from parvec

Usage

1
2
Calc_fold_CV_Error(TRAIN, TestInd, fold, ndsize, OutlierInd, parvec,
  tol = 10^-4, ntreestune = ntreestune)

Arguments

TRAIN

matrix of training cases with response in last column

TestInd

Matrix indicating which cases are in test (validation) set, TRAIN2

fold

number of fold within cross validation

ndsize

nodesize random forest tuning parameter for cross validation

OutlierInd

Vector of zeros and ones indicating whether training cases came from contaminating distribution

parvec

vector of candidate values for tuning parameter alpha

tol

maximal change in interation for LOWESSRF weights in cross validation

ntreestune

number of trees to use for forests involved in parameter tuning

Value

Returns array of dimensions 6 by 3 by length(parvec) containing errors. Dimensions index (1) type of error calculated 1-MSE without downweighting outliers in CV error 2-MAPE without downweighting outliers in CV error 3-MSE downweighting outliers according to BisqwtRF 4-MAPE downweighting outliers according to BisqwtRF 5-MSE downweighting outliers according to BisqwtRFL 6-MAPE downweighting outliers according to BisqwtRFL (2) applied to all cases in TRAIN2, outliers only, nonoutliers only (3) index of alpha from parvec


AndrewjSage/RFLOWESS documentation built on May 26, 2019, 6:38 a.m.