auto.boxjen: Automated Box-Jenkins method - Improved model selection with...

Description Usage Arguments Value See Also Examples

Description

Automated Box-Jenkins method - Improved model selection with flexible optimisation criteria.

Usage

1
2
3
4
5
6
auto.boxjen(y, method = "greedy", optimiser = "semi-stochastic",
  fixed = F, box_test = F, autolog = F, autodiffs = 1, autolags = F,
  r2_criterion = T, 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 = 200, plot = T, stdout = F)

Arguments

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>.

box_test

T/F flag. Indicates whether or not a Box-Pierce test for autocorrelation should be performed at every algorithm iteration.

autolog

Logarithmic search flag. Indicates whether or not log-transformation on the series will be decided algorithmically. Value "force": will force log-transformation.

autodiffs

Differencing search flag. T/F - Indicates whether or not the order of differencing will be algorithmically determined. Values "skip" or F of 0: will force to skip differencing. Negative values will force their absolute value to be set as the order of differencing.

autolags

Flag T/F indicating whether or not to set lags automatically as a function of the length of the series.

r2_criterion

Flag T/F incidating whether or not to use adjusted R-square as an ADF model selection criterion. When FALSE, the simplest possible stationarity transformation will be preferred.

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>

Value

Object of class "karma.fit"; (extends class "Arima" from package 'forecast').

See Also

tseries, forecast

Examples

1
2
3
4
# Automatic fit: (default: method = "greedy"; box-jenkins on insample CV)
magic.fit <- auto.boxjen(ldeaths)   
# Apply cross-validation and calculate MAPE on out-of-sample (test) data:
karma.cv(magic.fit)

snarf-snarf/karma documentation built on May 24, 2019, 7:19 a.m.