etalonnage | R Documentation |
To train and evaluate the models, a rolling-origin-update evaluation (ROUE)
is implemented, meaning that the forecast origin rolls ahead in time.
At each step, ROUE increments the traning set by one observation of the test
set. The date of the first sample to predict is given by forecast_origin
plus 1 quarter. Note that the training set always starts at the first sample
of X
.
To take into account the non-synchronicity of data publications, use the
extend
argument to indicate which series need to
be extended. This way the forecast accuracy can be assessed on the basis of
a pseudo real-time experiment i.e. replicating the timeliness of the
releases of the series by taking into account their publication lags.
This ensures to consider only those values of the series that would have
been available on the date on which the forecasts were calculated.
etalonnage( X, y, forecast_origin, name = NULL, regressor = c("randomForest", "xgboost", "glmnet", "lm"), extend = NULL, extend_mode = c("ARIMA", "constant"), scale = c("none", "center", "scale"), frequency = "quarter", seed = 313, ... )
X |
A tibble/df containing the regressors at a quarterly frequency. Must contain a date column. |
y |
A vector containing the target variable. |
forecast_origin |
A character indicating the first forecast origin, it
must be of the form |
name |
A character indicating a name for the analysis - if missing
defaults to |
regressor |
A character. For now, only |
extend |
A list of 2 elements. The 1st one contains a vector of
characters indicating columns to extend when fitting models, the 2nd one
contains a vector indicating the number of samples to remove and predict for
each column - if missing defaults to |
extend_mode |
Indicates whether to extend columns in |
scale |
Indicates whether to leave unchanged, center or scale |
frequency |
A character indicating the date frequency - if missing
defaults to |
seed |
A numeric value interpreted as an integer. |
... |
Aditionnal arguments to pass to the regressor. |
An object from S3 class etalonnage
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.