Legacy Documentation

Time Series (2011)

This is documentation for an obsolete product.
Current products and services

Previous section-----Next section

2.1 Model Properties

A discrete time series consists of a set of observations {x1, x2, ... , xt, ... } of some phenomenon, taken at equally spaced time intervals. (We assume that xt is real.) The main purpose of time series analysis is to understand the underlying mechanism that generates the observed data and, in turn, to forecast future values. We assume that the generating mechanism is probabilistic and that the observed series {x1, x2, ... , xt, ... } is a realization of a stochastic process {X1, X2, ... , Xt, ... }. Typically, the process is assumed to be stationary and described by a class of linear models called autoregressive moving average (ARMA) models.
An ARMA model of orders p and q (ARMA(p, q)) is defined by
where {i} and {i} are the coefficients of the autoregressive (AR) and moving average (MA) parts, respectively, and {Zt} is white noise with mean zero and variance 2. (We assume Zt is normally distributed.) Using the backward shift operator B defined by BjXt=Xt-j, the ARMA(p, q) model above can be written as
where (B)=1-1B-2B2-... -pBp and (B)=1+1B+2B2+... +qBq. We assume that the polynomials (x) and (x) have no common zeros. When Xt is a vector, we have a multivariate or vector ARMA model; in this case, the AR and MA coefficients are matrices and the noise covariance is also a matrix denoted by . When all the zeros of the polynomial (x) (or its determinant in the multivariate case) are outside the unit circle, the model is said to be stationary and the ARMA(p, q) model can be expanded formally as an MA() model (Xt=iZt-i). Similarly, if the zeros of (x) are all outside the unit circle, the ARMA(p, q) model is said to be invertible and can be expanded as an AR() model.
Autoregressive integrated moving average (ARIMA) models are used to model a special class of nonstationary series. An ARIMA(p, d, q) (d non-negative integer) model is defined by
Seasonal models are used to incorporate cyclic components in models. A class of commonly encountered seasonal models is that of seasonal ARIMA (SARIMA) models. A SARIMA(p, d, q)(P, D, Q)s model (d and D are non-negative integers and s is the period) is defined by
where (x) and (x) are polynomials that describe the seasonal part of the process.
The commonly used time series models are represented in this package by objects of the generic form model[param1, param2,...]. Each of these objects serves to specify a particular model and does not itself evaluate to anything. They can be entered as arguments of time series functions as well as generated as output.
ARModel[philist, 2]
AR(p) model with p AR coefficients in philist and normally distributed noise with variance 2
MAModel[thetalist, 2]
MA(q) model with q MA coefficients in thetalist and normally distributed noise with variance 2
ARMAModel[philist, thetalist, 2]
ARMA(p, q) model with p AR and q MA coefficients in philist and thetalist, respectively, and normally distributed noise with variance 2
ARIMAModel[d, philist, thetalist, 2]
ARIMA(p, d, q) model with p AR and q MA coefficients in philist and thetalist, respectively, and normally distributed noise with variance 2
SARIMAModel[{d, D}, s, philist, Philist, thetalist, Thetalist, 2]
SARIMA(p, d, q)(P, D, Q)s model with p regular and P seasonal AR coefficients in philist and Philist and q regular and Q seasonal MA coefficients in thetalist and Thetalist, respectively, and normally distributed noise with variance 2

Time series models.

Here, when model is used as a Mathematica function argument it means the model object defined above. The notation philist denotes a list of AR coefficients {1, 2, ... , p}, thetalist specifies a list of MA coefficients {1, 2, ... , q}, and so on. The noise is zero-mean Gaussian white noise, and its variance or covariance matrix will be called the noise parameter. d (or D) is the order of differencing, and s is the seasonal period. To extract any of these arguments from a model, we can use the function Part or one of the following functions.
ARCoefficients[model]
extract the AR coefficients of model
MACoefficients[model]
extract the MA coefficients of model
SeasonalARCoefficients[model]
extract the seasonal AR coefficients of model
SeasonalMACoefficients[model]
extract the seasonal MA coefficients of model
SeasonalPeriod[model]
extract the seasonal period of model
DifferencingOrder[model]
extract the differencing order of model
NoiseParameter[model]
extract the noise parameter of model

Functions extracting the parameters of time series models.

All of the functions in this package with the exception of AsymptoticCovariance and the functions analyzing ARCH models work for both univariate and multivariate cases, although some are illustrated using examples of univariate series only.
In[1]:=
In[2]:=
Out[2]=
In[3]:=
Out[3]=
We can also use the function Part to extract the argument.
In[4]:=
Out[4]=
In[5]:=
Out[5]=
In[6]:=
Out[6]=
ToARModel[model, n]
give the AR(n) model that is the order n truncation of the AR() expansion of model
ToMAModel[model, n]
give the MA(n) model that is the order n truncation of the MA() expansion of model
ToARMAModel[model]
convert an ARIMA or a SARIMA model to an ARMA model

Conversions of time series models.

In[7]:=
Out[7]=
In[8]:=
Out[8]=
In[9]:=
Out[9]=
In[10]:=
Out[10]=
In[11]:=
Out[11]=
Given a model, its covariance function and correlation function can be calculated. For a univariate zero-mean, stationary process, the covariance function at lag h is defined by (h)=E(Xt+hXt) (E denotes the expectation); the correlation function, by (h)=(h)/(0). For a multivariate process, the matrix covariance function is defined by (X denotes the transpose of X), and the matrix correlation function at lag h, R(h), is given by where ij(h)=((h))ij. Another useful function is the partial correlation function. The partial correlation function at lag k, k, k, is defined to be the correlation between Xt+k and Xt with all intervening variables fixed. The power spectrum of a univariate ARMA(p, q) process is given by , and for a multivariate process the power spectrum is .
StationaryQ[model]give True if model is stationary, False otherwise
StationaryQ[philist]
give True if the model with its AR coefficients in philist is stationary, False otherwise
InvertibleQ[model]
give True if model is invertible, False otherwise
InvertibleQ[thetalist]
give True if the model with its MA coefficients in thetalist is invertible, False otherwise
CovarianceFunction[model, n]
give the covariance function of model up to lag n
CorrelationFunction[model, n]
give the correlation function of model up to lag n
PartialCorrelationFunction[model, n]
give the partial correlation function of model up to lag n
Spectrum[model, ]
give the power spectrum of model as a function of

Properties of time series models.

In[12]:=
Out[12]=
In[13]:=
Out[13]=
In[14]:=
Out[14]=
In[15]:=
Out[15]=
In[16]:=
Out[16]=
In[17]:=
Out[17]=
In[18]:=
Out[18]=
In[19]:=
Out[19]=
In[20]:=
Out[20]=
In[21]:=
Out[21]=
RandomSequence[, 2, n]
generate a random sequence of length n distributed normally with mean and variance 2
TimeSeries[model, n]
generate a time series of length n from model
TimeSeries[model, n, {x-p+1, x-p+2, ..., x0} ]
generate a time series with p given initial values
TimeSeries[model, n, {z-q+1, z-q+2, ..., zn}, {x-p+1, x-p+2, ..., x0} ]
generate a time series with a given noise sequence {z} and initial values {x}

Generating random sequences and time series.

Both RandomSequence and TimeSeries uses the current default random number generator. Sequences generated prior to Version 6.0 of Mathematica can be obtained by including the option LegacySequence→True.
In[22]:=
Out[22]=
In[23]:=
Out[23]=
In[24]:=
Out[24]=
In[25]:=
Out[25]=
In[26]:=
Out[26]=
In[27]:=
Out[27]=