Annotated Equations
A quick reference for the models introduced in the R Tutorial.
Moving average (MA) model
Instead of using past values like an AR model, an MA model uses past errors to predict the current observation.
\[ y_t = \underbrace{\color{#2b6cb0}{c}}_{\textstyle\color{#2b6cb0}{\text{constant}}} \;+\; \underbrace{\color{#7c3aed}{\theta_1 \epsilon_{t-1}}}_{\textstyle\color{#7c3aed}{\text{MA: lag-1}}} \;+\; \underbrace{\color{#718096}{\epsilon_t}}_{\textstyle\color{#718096}{\text{random error}}} \]
- \(y_t\) — the observed value at time \(t\)
- \(c\) — a constant, analogous to the intercept in a regression
- \(\theta_1 \epsilon_{t-1}\) — the lag-1 MA effect: \(\theta_1\) scales how much last time step’s error (not value) carries over
- \(\epsilon_t\) — random error at time \(t\)
Reading the coefficient: if \(\theta_1 > 0\), an observation that came in above the mean last time step nudges this time step above the mean too. Positive MA components say an outlier tends to be followed by another outlier in the same direction — unlike an AR model, it’s the surprise, not the value, that carries forward.
ARMA model
AR and MA structure can both be present in the same time series — an ARMA model combines them.
\[ y_t = \underbrace{\color{#2b6cb0}{c}}_{\textstyle\color{#2b6cb0}{\text{constant}}} \;+\; \underbrace{\color{#c05621}{b_1 y_{t-1}}}_{\textstyle\color{#c05621}{\text{AR: lag-1}}} \;+\; \underbrace{\color{#7c3aed}{\theta_1 \epsilon_{t-1}}}_{\textstyle\color{#7c3aed}{\text{MA: lag-1}}} \;+\; \underbrace{\color{#718096}{\epsilon_t}}_{\textstyle\color{#718096}{\text{random error}}} \]
- \(y_t\) — the observed value at time \(t\)
- \(c\) — a constant
- \(b_1 y_{t-1}\) — the AR part: the effect of the previous value
- \(\theta_1 \epsilon_{t-1}\) — the MA part: the effect of the previous error
- \(\epsilon_t\) — random error at time \(t\)
Differencing
ARIMA-family models assume the series is “stationary” — no overall trend. Differencing removes a trend by modeling the change from one time step to the next instead of the raw values.
\[ y_t' = \underbrace{\color{#38a169}{y_t}}_{\textstyle\color{#38a169}{\text{current value}}} \;-\; \underbrace{\color{#92400e}{y_{t-1}}}_{\textstyle\color{#92400e}{\text{previous value}}} \]
- \(y_t'\) — the differenced series: how much the value changed since last time step
- \(y_t\) — the current value
- \(y_{t-1}\) — the previous value
Why this matters: once the data is differenced, the model is no longer fit to the raw values but to the changes between them, which removes a long-term trend before the AR/MA structure is estimated.
A fitted example: MA(3)
Fitting ARIMA() with no structure specified can return a model like this one — a 3rd-order MA model with no differencing and no AR terms.
\[ y_t = \underbrace{\color{#2b6cb0}{c}}_{\textstyle\color{#2b6cb0}{\text{constant}}} \;+\; \underbrace{ \color{#7c3aed}{\theta_1 \epsilon_{t-1}} \color{black}{\,+\,} \color{#9333ea}{\theta_2 \epsilon_{t-2}} \color{black}{\,+\,} \color{#c026d3}{\theta_3 \epsilon_{t-3}} }_{\textstyle\color{#9333ea}{\text{MA terms: lags 1-3}}} \;+\; \underbrace{\color{#718096}{\epsilon_t}}_{\textstyle\color{#718096}{\text{random error}}} \]
- \(y_t\) — the observed value at time \(t\)
- \(c\) — a constant
- \(\theta_1 \epsilon_{t-1}\), \(\theta_2 \epsilon_{t-2}\), \(\theta_3 \epsilon_{t-3}\) — the MA(3) terms: this model uses the last three months’ errors, shown in the
Coefficientstable asma1,ma2,ma3 - \(\epsilon_t\) — random error at time \(t\)
Reading it: if NDVI was above average over the last three months, this model expects it to be above average now too — consistent with the idea that a good year (an MA-style “outlier” in errors) tends to persist for a while.
Seasonal AR term
ARIMA models can also capture a seasonal cycle directly, by using a lag equal to the length of one full cycle — here, 12 months.
\[ y_t = \underbrace{\color{#2b6cb0}{c}}_{\textstyle\color{#2b6cb0}{\text{constant}}} \;+\; \underbrace{\color{#dd6b20}{b_{12} y_{t-12}}}_{\textstyle\color{#dd6b20}{\text{seasonal effect (1 year back)}}} \]
- \(y_t\) — the observed value at time \(t\)
- \(c\) — a constant
- \(b_{12} y_{t-12}\) — the seasonal AR term: how strongly the value from exactly one year ago (
sar1in theCoefficientstable) predicts the current value
Ecological connection: it makes sense that greenness one year ago is informative — ecosystems are reliably greener in summer than winter, so “how green was it this time last year” is a good predictor of “how green is it now.”
Full seasonal ARIMA model
Like the MA(3) model above but with a seasonal AR term added.
\[ y_t = \underbrace{\color{#2b6cb0}{c}}_{\textstyle\color{#2b6cb0}{\text{constant}}} \;+\; \underbrace{ \color{#7c3aed}{\theta_1 \epsilon_{t-1}} \color{black}{\,+\,} \color{#9333ea}{\theta_2 \epsilon_{t-2}} \color{black}{\,+\,} \color{#c026d3}{\theta_3 \epsilon_{t-3}} }_{\textstyle\color{#9333ea}{\text{MA terms: lags 1-3}}} \;+\; \underbrace{\color{#dd6b20}{b_{12} y_{t-12}}}_{\textstyle\color{#dd6b20}{\text{seasonal effect}}} \;+\; \underbrace{\color{#718096}{\epsilon_t}}_{\textstyle\color{#718096}{\text{random error}}} \]
- \(y_t\) — the observed value at time \(t\)
- \(c\) — a constant
- \(\theta_1 \epsilon_{t-1}\), \(\theta_2 \epsilon_{t-2}\), \(\theta_3 \epsilon_{t-3}\) — the MA(3) terms from the last three months’ errors
- \(b_{12} y_{t-12}\) — the seasonal AR term from one year back
- \(\epsilon_t\) — random error at time \(t\)
Putting it together: this model explains the current value using recent surprises (MA), last year’s value (seasonal AR), and nothing else — no direct AR terms on the immediately preceding months were needed once the seasonal and MA structure were included.