Description Usage Arguments Value See Also Examples
ARIMA model optimisation: Improved automatic model selection with flexible optimisation criteria.
1 2 3 4 5 | karma.ann(y, method = "greedy", optimiser = "semi-stochastic", fixed = F,
autolog = F, autodiffs = 1, test_pct = 20, test_type = "percentage",
metric = "MAPE", cv = "out", ac_criterion = F, mutations = F,
xreg = NULL, N = 100, max_ar = 20, max_ma = 20, max_conv = 2,
max_rep = 1, max_iter = 15, plot = T, stdout = F)
|
y |
A univariate time-series vector; type <numeric> or <ts>. |
method |
Generic selection algorithm; "greedy": a fully automated karma.boxjenkins in-sample search (default options make it similar to forward selection); "karma": A custom stochastic local search algorithm. |
optimiser |
Option on the "neighbourhood function" of the optimisation algorithm; "semi-stochastic": Once a neighbourhood region (of either AR and MA terms) has been selected randomly, the candidate solutions are chosen deterministically; "stochastic": Once a neighbourhood region (of either AR and MA terms) has been selected randomly, the candidate neighbour solutions are chosen stochastically. |
fixed |
Fixed term flag. Indicate whether the fixed term option in Arima() needs to be switched on during model selection; T, F; type <logical>. |
autolog |
Logarithmic search flag. Indicates whether log-transformations on the input series will be part of the search. |
autodiffs |
Differencing search flag. Indicates whether differencing on the input series will be part of the search. |
test_pct |
Percentage of train-test split in cross-validation (e.g. 70-30). |
test_type |
Train-test split type, i.e. percentage or fixed window; "percentage": test_pct = 12 will be read as the 12 percent of the length of the series; "window": test_pct = 12 will be read as the 12 last time points (e.g. months) of the series. |
metric |
Choose a model validation metric that will be used as the main optimisation criterion during model selection. |
cv |
Choose cross-validation dataset to be used during model selection; "out": Performance of out-of-sample forecast (classic train/test split) will be used for model validation; "in": Performance of in-sample forecast (classic parametric regression type of validation) will be used for model validation. |
ac_criterion |
Aucocorrelation / Partial autocorrelation test flag on/off; An optional optimisation constraint which applies portmanteau test on every candidate solution and rejects solutions that do not improve AC/PAC. |
mutations |
Optional neighbourhood operator; Mutations flag T, F: whether or not to apply random "mutations" (term borrowed from evolutionary algorithms) on a candidate solution when the optimiser is about to converge (a way to escape local optima - works somewhat like an inverse simulated annealing). |
xreg |
Optional vector or matrix of exogenous regressors; see documentation for Arima(), package 'forecast'. |
N |
Maximum lag at which to calculate autocorrelation and partial autocorrelatin functions; see documentation for acf(), pacf(). |
max_ar |
Maximum AR term (value of p). |
max_ma |
Maximum MA term (value of q). |
max_conv |
For karma.boxjenkins(): Maximum number of iterations without improvement before the algorithm converges forcefully (stuck to a local optimum). |
max_rep |
For karma-search: Maximum number of iterations without improvement before the algorithm converges naturally (reached a global or local optimum). |
max_iter |
For karma.boxjenkins(): Maximum number of iterations without improvement before the algorithm converges naturally (reached a global or local optimum). |
plot |
Option to depict plots during local search; if TRUE (default), AC and PAC plots are active. <logical> |
stdout |
Option to output optimisation diagnostics during local search; <logical> |
Object of class "karma.fit"; (extends class "Arima" from package 'forecast').
1 2 3 4 | # Automatic fit: (default: method = "greedy"; box-jenkins on insample CV)
magic.fit <- magic.karma(WWWusage)
# Apply cross-validation and calculate MAPE on out-of-sample (test) data:
karma.cv(magic.fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.