Given a timeseries, apply an ARIMA(p, d, q) model to it.
Given a timeseries, apply an ARIMA(p, d, q) model to it. We assume that prior MA terms are 0.0 and prior AR terms are equal to the intercept or 0.0 if fit without an intercept
Time series of i.i.d. observations.
The dest series, representing the application of the model to provided error terms, for convenience.
Calculates an approximation to the Akaike Information Criterion (AIC).
Calculates an approximation to the Akaike Information Criterion (AIC). This is an approximation as we use the conditional likelihood, rather than the exact likelihood. Please see https://en.wikipedia.org/wiki/Akaike_information_criterion for more information on this measure.
the timeseries to evaluate under current model
an approximation to the AIC under the current model
Provided fitted values for timeseries ts as 1-step ahead forecasts, based on current
model parameters, and then provide nFuture
periods of forecast.
Provided fitted values for timeseries ts as 1-step ahead forecasts, based on current
model parameters, and then provide nFuture
periods of forecast. We assume AR terms
prior to the start of the series are equal to the model's intercept term (or 0.0, if fit
without and intercept term).Meanwhile, MA terms prior to the start are assumed to be 0.0. If
there is differencing, the first d terms come from the original series.
Timeseries to use as gold-standard. Each value (i) in the returning series is a 1-step ahead forecast of ts(i). We use the difference between ts(i) - estimate(i) to calculate the error at time i, which is used for the moving average terms.
Periods in the future to forecast (beyond length of ts)
a series consisting of fitted 1-step ahead forecasts for historicals and then
nFuture
periods of forecasts. Note that in the future values error terms become
zero and prior predictions are used for any AR terms.
Calculates the gradient for the log likelihood function using CSS Derivation: L(y | \theta) = -\frac{n}{2}log(2\pi\sigma2) - \frac{1}{2\pi}\sum_{i=1}n \epsilon_t2 \\ \sigma2 = \frac{\sum_{i = 1}n \epsilon_t2}{n} \\ \frac{\partial L}{\partial \theta} = -\frac{1}{\sigma2} \sum_{i = 1}n \epsilon_t \frac{\partial \epsilon_t}{\partial \theta} \\ \frac{\partial \epsilon_t}{\partial \theta} = -\frac{\partial \hat{y}}{\partial \theta} \\ \frac{\partial\hat{y}}{\partial c} = 1 + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial c} \\ \frac{\partial\hat{y}}{\partial \theta_{ar_i}} = y_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ar_i}} \\ \frac{\partial\hat{y}}{\partial \theta_{ma_i}} = \epsilon_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ma_i}} \\
Calculates the gradient for the log likelihood function using CSS Derivation: L(y | \theta) = -\frac{n}{2}log(2\pi\sigma2) - \frac{1}{2\pi}\sum_{i=1}n \epsilon_t2 \\ \sigma2 = \frac{\sum_{i = 1}n \epsilon_t2}{n} \\ \frac{\partial L}{\partial \theta} = -\frac{1}{\sigma2} \sum_{i = 1}n \epsilon_t \frac{\partial \epsilon_t}{\partial \theta} \\ \frac{\partial \epsilon_t}{\partial \theta} = -\frac{\partial \hat{y}}{\partial \theta} \\ \frac{\partial\hat{y}}{\partial c} = 1 + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial c} \\ \frac{\partial\hat{y}}{\partial \theta_{ar_i}} = y_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ar_i}} \\ \frac{\partial\hat{y}}{\partial \theta_{ma_i}} = \epsilon_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ma_i}} \\
array of differenced values
Checks if MA parameters result in an invertible model.
Checks if MA parameters result in an invertible model. Checks this by solving the roots for 1 + theta_1 * x + theta_2 * x + ... + theta_q * x^q = 0. Please see ARIMAModel.isStationary for more details. Always returns true for models with no MA terms.
indicator of whether model's MA parameters are invertible
Check if the AR parameters result in a stationary model.
Check if the AR parameters result in a stationary model. This is done by obtaining the roots to the polynomial 1 - phi_1 * x - phi_2 * x2 - ... - phi_p * xp = 0, where phi_i is the corresponding AR parameter. Note that we check the roots, not the inverse of the roots, so we check that they lie outside of the unit circle. Always returns true for models with no AR terms. See http://www.econ.ku.dk/metrics/Econometrics2_05_II/Slides/07_univariatetimeseries_2pp.pdf for more information (specifically slides 23 - 25)
indicator of whether model's AR parameters are stationary
log likelihood based on conditional sum of squares
log likelihood based on conditional sum of squares
Source: http://www.nuffield.ox.ac.uk/economics/papers/1997/w6/ma.pdf
time series
log likelihood
log likelihood based on conditional sum of squares.
log likelihood based on conditional sum of squares. In contrast to logLikelihoodCSS the array provided should correspond to an already differenced array, so that the function below corresponds to the log likelihood for the ARMA rather than the ARIMA process
differenced array
log likelihood of ARMA
Given a timeseries, assume that it is the result of an ARIMA(p, d, q) process, and apply inverse operations to obtain the original series of underlying errors.
Given a timeseries, assume that it is the result of an ARIMA(p, d, q) process, and apply inverse operations to obtain the original series of underlying errors. To do so, we assume prior MA terms are 0.0, and prior AR are equal to the model's intercept or 0.0 if fit without an intercept
Time series of observations with this model's characteristics.
The dest series, representing remaining errors, for convenience.
Sample a series of size n assuming an ARIMA(p, d, q) process.
Sample a series of size n assuming an ARIMA(p, d, q) process.
size of sample
series reflecting ARIMA(p, d, q) process