Description Usage Arguments Details Value Author(s) References Examples
View source: R/nested_cross_validation.R
This function computes a nested cross validation (with the rolling forecasting origin). The data is split into 3 datasets: training, test and evaluation dataset. The best model is selected on the test and its performance is measured on the evaluation dataset.
1 2 | nested_cross_validation(UnivariateData, Horizon=14, EvaluationLength=2, TestLength=2,
Method = "r", MultivariateData=NULL, NumMV=1, NumClusters = 1)
|
UnivariateData |
[1:n] Numerical vector with n values. |
Horizon |
Number indicating horizon for forecast from 1 to horizon. |
EvaluationLength |
Number indicating how many points are used for cross validation for the evaluation dataset. |
TestLength |
Number indicating how many points are used for cross validation for the test dataset. |
Method |
String indicating which method to use. Available methods: 'r' = Autoregression. 'nn' = Neural Network. |
MultivariateData |
Not implemented yet. |
NumMV |
Not implemented yet. |
NumClusters |
Number of clusters used for parallel computing. |
The evaluation function (optimization function) is built with a rolling forecasting origin (rolling_window function), which computes a h-step ahead forecast (for h = 1, ..., horizon) for window_size many steps. The input space is searched with an evolutionary optimization method. The deployed forecast method can be an autoregression or a neural network (multilayer perceptron with one hidden layer).
Best |
[1:Scales+1] Numerical vector with integers associated with the best found number of coefficients per wavelet scale (1:Scales) and number of coefficients for the smooth approximation level in the last entry. |
Error |
[1:Window, 1:Horizon] Numerical Matrix with 'Window' many rows entries indicating one time point with 'Horizon' many forecast errors. |
Forecast |
[1:Window, 1:Horizon] Numerical Matrix with 'Window' many rows entries indicating one time point with 'Horizon' many forecasts. |
Quirin Stier
Hyndman, R. and Athanasopoulos, G. Forecasting: principles and practice. OTexts, 3 edition. 2018.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.