# Find state space model to compare with Box-Jenkins ARIMA model

I asked a question here about how to get predictions for the random-walk component of an ARIMA model.

Are there time series models in the state-space framework that might be suitable for the kind of data used with ARIMA models, perhaps for series similar to the one in the linked question? I would like to know how to build a model using state-space models rather than Box-Jenkins methods such that I can implement a Kalman filter to predict the random walk portion of the signal.

• I appreciate the feedback here, but there was no feedback on the existing question after editing. Don't be a purist or you make this site useless for people ramping up (not at the same skill level as you). Also - i did a search on the "what happens after a hold" and couldn't find a procedure so what am I supposed to do. – JPJ Oct 27 '15 at 20:34
• I would also add -- if i knew more about SSF and building models, I would at least be able to provide constructive feedback to someone with the question. Surely you who spend so much time critiquing the question could channel that energy into useful/constructive feedback on links or other knowledge to at least lead me to a tutorial or something. – JPJ Oct 27 '15 at 20:37
• We do have some "show me how to build a model using a particular technique" questions so it's not inherently off-topic here, but only in a statistical sense (i.e. not a walkthrough on what buttons to press in your software). But they've generally been clearer than yours about what they want. If we are going to have a "how can I model this data" question, I'd far rather it were based on data that is posted right here (e.g. could be pasted in CSV or similar form into a code block) or on famous data sets that are widely available, than relying on an external link that could go dead – Silverfish Oct 27 '15 at 20:59
• ctd... You can also catch the attention of any one person who has commented on your question by placing an @ in front of their username to ask what else is needed. There's also guidance in the help and on stackexchange meta about how to write good questions, and some additional help on our own meta on stats questions. e.g. here's one somewhat relevant part of the help stats.stackexchange.com/help/how-to-ask – Glen_b Oct 27 '15 at 22:01
• If your question is 'how to explore these data & build a SS model', then it is too broad for this type of format. You need a book-length treatment. Your best bet would be to take a course or work through a textbook on the topic. Along the way, you may find you have specific, narrowly defined questions, which you would be welcome to post here. – gung Oct 27 '15 at 22:36

State-space models are very flexible; indeed they can encompass ARIMA models.

One class of state space models that has some overlap with ARIMA models but also has a large subset of models that don't overlap with them is the Basic Structural Model (BSM). See Harvey (1989)[1]. There are also numerous papers by Harvey (usually with other authors) relating to the BSM and at least a couple of other books. Structural models are also sometimes called unobserved components models (UCM). For example, the 1990 paper by Harvey and Peters ("Estimation Procedures for Structural Time Series Models," J. Forecasting) is not hard to locate and has some useful details that are also in the book reference I give.

Here's an outline of the Basic Structural Model:

$$y_t = \mu_t + \gamma_t +\epsilon_t,\qquad t=1,...,T$$

where $\mu_t$ is the trend component, $\gamma_t$ is a seasonal component and $\epsilon_t$ an irregular component (or noise).

The model for $\mu_t$ is:

\begin{eqnarray} \mu_t&=&\mu_{t-1}+\beta_{t-1}+\eta_t\\ \beta_t&=&\beta_{t-1}+\zeta_t \end{eqnarray}

with $\eta_t$ and $\zeta_t$ independent of each other and across time; they have mean zero and each has its own variance.

The trend component $\mu$ is "locally linear"; $\beta_t$ is the local slope.

There are several ways to write a seasonal component. The "seasonal dummy" formulation is:

$$\gamma_t=-\sum_{j=1}^{s-t}\gamma_{t-j}\,\omega_t$$

where $\omega_t$ is another independently distributed disturbance term with its own variance.

[There's also a different seasonal model that can be used based on sin and cos components.]

The parameters $\mu_t,\beta_t,\gamma_t$ form the state. The first equation is the observation equation and the remaining equations (put together) define the state equation.

The BSM is readily extended in any number of ways, or can be made more specific by omitting unneeded components (e.g. leaving out the seasonal component if there's no seasonality), and has the nice property that its state components have nice human-understandable interpretations.

A pure random walk with noise model would set $\beta$'s and $\gamma$'s to zero:

\begin{eqnarray} y_t &=& \mu_t + \epsilon_t,\qquad t=1,...,T\\ \mu_t&=&\mu_{t-1}+\eta_t \end{eqnarray}

(and a straight-out pure random walk would set $\epsilon$ to 0).

Another paper you might find relevant is Harvey and Todd (1983) "Forecasting Economic Time Series with Structural and Box-Jenkins Models", J. Business & Economic Statistics, 1:4, since it seems to be closely related to what you are trying to do - compare state space models with ARIMA.

Many stats packages offer BSM models or something very similar; there's UCM in SAS, there's the StructTS package in R, and so on -- so you don't really have to do much to even set up the state space model (not that it's onerous).

[1]: Andrew C. Harvey (1989) Forecasting, Structural Time Series Models and the Kalman Filter, Cambridge University Press

• This is very helpful! – JPJ Oct 27 '15 at 23:32
• @Glen_b very nice answer. – forecaster Oct 27 '15 at 23:54
• It's possible that Hyndman and Athenasopoulos's online book would be useful to you. I've highlighted the section on exponential smoothing, which has a section on state space models. otexts.org/fpp/7/7 and comparisons between exponential and ARIMA models otexts.org/fpp/8/10 – zbicyclist Oct 28 '15 at 16:00
• @zbicyclist A good thought -- exponential smoothing models are simple, natural candidates for the state space framework... (but it's Athanasopoulos rather than Athenasopoulos). I think they're (or at least the simpler versions of exponential smoothing are) actually part of the BSM. – Glen_b Oct 28 '15 at 22:16