Description Usage Arguments Value Examples
View source: R/select_model_hmnc.R
double seasonal harmonic regression is implemented. If grid.search = TRUE, grid search is applied by searching the number of Fourier terms for yearly seasonality. 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 | select_model_hmnc(
train.y,
valid.y = NULL,
s1 = 7,
s2 = 365.25,
grid.search = FALSE,
search.length = c(20, 40),
length.out = 5
)
|
train.y |
A numeric vector for training. |
valid.y |
A numeric vector for validating If |
s1 |
Period of the shorter seasonal period. |
s2 |
Period of the longer seasonal period. |
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 |
A list contains:
model. An object of class forecast
. The model is built by combining training and testing;
K. A vector display the number of Fourier term for weekly seasonality and yearly seasonality.
cv. A data frame of searched parameters with respect to its distance measures (see measure_dist
)
1 2 3 4 5 | 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_hmnc(train.y, valid.y, grid.search = TRUE, length.out = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.