Description Usage Arguments Value

Parameter tuning function #' For each candidate parameter value, calculate the CV error resulting from growing a forest on TRAIN1, predicting TRAIN2, and downweighting contributions in TRAIN2 based on either RF residuals or RFL residuals using OOB predictions when TRAIN2 was predicted using RF grown on TRAIN2. In cross validation, this is done for each candidate value, within each fold, within each rep.

1 2 | ```
Calculate_CV_Error(OOBWeights1, PredWeights1, TRAINY, samp, parvec, ind,
tol = 10^-4, BisqwtRF, BisqwtRFL, OutlierInd)
``` |

`OOBWeights1` |
OOB prediction weights for training cases in TRAIN1 |

`PredWeights1` |
Prediction weights for predicting test (validation) cases using training cases |

`TRAINY` |
responses for all training cases |

`samp` |
list of indexes of test (or validation) cases (i.e. TRAIN2) |

`parvec` |
vector of candidate values for tuning parameter alpha |

`ind` |
index of parameter tuning vector to work on |

`tol` |
maximal change in interation for LOWESSRF weights in cross validation |

`BisqwtRF` |
Weight to be applied to each test or validation case when using cross validation to set tuning parameter, using RF outliers for downweighting |

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

Returns a 6 by 3 matrix with errors. Rows indicate type of weighting applied to errors in TRAIN2. 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 Columns represent error for all cases (1), only outliers (2), only nonoutliers(3)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.