Description Usage Arguments Value See Also Examples
Box-Jenkins method for ARMA model selection on a stationary process.
1 2 3 | karma.boxjenkins(y, diffs = 0, log = F, fixed = F, xreg = NULL,
N = 100, box_test = F, max_ar = 20, max_ma = 20, max_conv = 2,
max_iter = 200, plot = F, stdout = T)
|
y |
A univariate time-series vector; type <numeric> or <ts>. |
diffs |
Differencing step: Indicates whether the input series needs to be differenced for stationarity (and to what degree); 0,1,...,n; type <int>. |
log |
Logarithmic transformation flag. Indicates whether the input series needs to be log-transformed for stationarity; T, F; type <logical>. |
fixed |
Fixed term flag. Indicates whether the fixed term option in Arima() needs to be switched on during model selection; T, F; type <logical>. |
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(). |
box_test |
T/F flag. Indicates whether or not a Box-Pierce test for autocorrelation should be performed at every algorithm iteration. |
max_ar |
Maximum AR term (value of p). |
max_ma |
Maximum MA term (value of q). |
max_conv |
Maximum number of iterations without improvement before the algorithm converges forcefully (stuck to a local optimum). |
max_iter |
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 5 6 | # Find transformation steps required for stationarity:
stationarity.options <- karma.transform(ldeaths, stdout = F, autolog = F, autodiffs = 1)
# Apply Box-Jenkins method on the stationary series:
boxj.fit <- karma.boxjenkins(ldeaths, diffs = stationarity.options$diffs, log = stationarity.options$log)
# Apply cross-validation and calculate MAPE on out-of-sample (test) data:
karma.cv(boxj.fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.