Description Usage Arguments Value Author(s) Examples
Take data and candidate parameters and run grid search.
For efficiency, it computes in parallel with heuristics on CPU load balancing.
For SARIMA model fitting, it uses Arima
from forecast
.
Sometimes, the fitting results in error for specific parameter combination (e.g. failiure in stationarity).
In such case, it just ignores such combination.
If plot
is TRUE, it also plots the grid search result.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
data |
Time series data for grid search.
The data should be either |
p |
Candidates for AR order. |
d |
Candidates for degree of differencing. |
q |
Candidates for MA order. |
P |
Candidates for seasonal AR order. |
D |
Candidates for seasonal degree of differencing. |
Q |
Candidates for seasonal MA order. |
period |
Candidates for seasonal term period. Note that long period needs quite long computation time. |
... |
Extra arguments for SARIMA fitting.
Refer to |
criterion |
Model selection criterion.
Should be one of |
plot |
If |
verbose |
If |
A list containing the following elements:
min | Achieved minimum of the criterion. |
select | Selected model(Arima object). |
tune | Data frame holding the grid search result. Ordered by the criterion values. |
models | List of all models fitted. Ordered by the criterion values. |
plot | ggplot object of the plot. (Returned only if plot is TRUE.) |
Sanghyun Park, Daun Jeong, and Sehun Kim
1 2 3 4 5 6 7 8 | # 228 is the station code for SNU
data <- get.subway(228)
# Model selection
# It would take some time
model.select(data$total, p = 1:3, d = 1:3, q = 1:3,
P = 1:3, D = 1:3, Q = 1:3, period = c(1, 7),
criterion = "aic")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.