This vignette is intended to show the current ability to parse
objects generated by forecast::Arima()
by {equatiomatic},
thanks to contributions from Jay
Sumners. The output uses notation from Hyndman
with the exception of
and
for intercept and drift, respectively, being replace by
and
.
To improve readability and reduce formula size, Arima functions are
presented in Backshift (sometimes called lag) notation.
forecast::Arima()
will automatically generate either an
Arima model or a linear regression model with Arima errors. We’ll
address both in the examples below.
First we need to generate a model. In this example, we won’t worry too much about whether or not the model is appropriate. Rather, we aim to illustrate that the corresponding equations are parsed correctly.
To extract the equation, we just call
equatiomatic::extract_eq()
on the resulting model object,
equivalent to other model types. The model above outputs the
following.
extract_eq(simple_ts_mod)
Next, we’ll illustrate a slightly more complicated example that
includes a linear regression. We’ll use the ts_reg_list
object that is exported from {equatiomatic} to build up
our data.
Despite the extra complexity of the model, the code to pull the equation remains equivalent.
extract_eq(ts_reg_mod)
Although currently still in development, the other functionalities of
extract_eq()
for lm
objects should generally
work for forecast::Arima
objects as well (e.g. interaction
terms). Please let us know (preferably with a reproducible example) if
you run into any issues.
Development items on the docket include:
Testing additional functionality from extract_eq()
for lm
objects.
Implementation of arguments that will allow the user to rename variables and/or specify a set of greek letters.
If there is interest, the ability to switch to an expanded version of the equation. However, this could potentially generate extremely long and difficult to read equations.
This is the first of (hopefully) most of the models in
forecast
being implemented in {equatiomatic}.
Arima
is one of the most used modeling techniques for
time-series and, as such, got first treatment. There’s a lot we can do
from here and I’m happy for any help or feedback from the community.