Description Usage Arguments Value Examples
double seasonal exponential smoothing method is implemented. If grid.search = TRUE, grid search is applied by searching parameters around the "first attempt" parameters. search.length
and length.out
are for grid search. The search is based on the minimum mean absolute percentage error with parallel computing. More details about parallel computing can be found in doParallel
.
1 2 3 4 5 6 7 8 9 10 11 12 |
train.y |
A numeric vector for training. |
valid.y |
A numeric vector for testing. If |
s1 |
Period of the shorter seasonal period. |
s2 |
Period of the longer seasonal period. |
h |
Number of periods for forecasting. |
grid.search |
If TRUE, a grid search is applied. |
search.length |
Grid search parameter. Only used if |
length.out |
Grid search parameter. Only used if |
CV |
If TRUE, k-fold cross validation applied |
kfold |
The number of K-fold |
If grid.search = FALSE
, an object of class forecast
is return. Otherwise, a list contains:
model. An object of class forecast
. The model is built by combining training and testing;
cv. A data frame of searched parameters with respect to its distance measures (see measure_dist
)
1 2 3 4 5 6 | data(tickets)
data.ls = train_test_split(tickets, var = "date", train.window = c(20140701, 20180630), test.window = c(20180701, 20190630))
train.y = data.ls$train.dat[,2]
valid.y = data.ls$test.dat[,2]
select.ls = select_model(train.y, valid.y, grid.search = TRUE, length.out = 2)
Double seasonal exponential time series cross validation
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.