4 Time Series Concepts

Updated: February 3, 2022

Copyright © Eric Zivot 2015, 2016, 2017

Financial variables such as asset prices and returns are naturally ordered by time. That is, these variables are time series variables. When we construct returns, the time index or data frequency becomes the investment horizon associated with the return. Typical data frequencies are daily, weekly, monthly and annual. In building probability models for time series variables, the time ordering of the data matters because we may think there are important temporal dependencies among the variables. For example, we might have reason to believe that the return on an asset this month is correlated with the return on the same asset in the previous month. This autocorrelation can only be defined if the time ordering of the data is preserved. A major complication in analyzing time series data is that the usual assumption of random sampling from a common population is not appropriate because it does not allow for any kind of time dependence in the time series variables. We would like to retain the notion that the observed data come from some population model, perhaps with time-invariant parameters, but we would like to allow the variables to have time dependencies. Fortunately, we can do this if the time series data come from a stationary time series process.

This chapter reviews some basic times series concepts that are essential for describing and modeling financial time series. Section 4.1 defines univariate time series processes and introduces the important concepts of stationarity and ergodicity. Covariance stationary time series processes are defined, which gives meaning to measuring linear time dependence using autocorrelation. The benchmark Gaussian White Noise process and related processes are introduced and illustrated using R. Some common non-stationary time series processes are also discussed including the famous random walk model. Section 4.2 introduces covariance stationary multivariate time series process. Such processes allow for dynamic interactions among groups of time series variables. Section 4.3 discusses time series model building and introduces the class of univariate autoregressive-moving average time series models and multivariate vector autoregression models. The properties of some simple models are derived and it is shown how to simulate observations from these models using R. The chapter concludes with a brief discussion of forecasting from time series models.

The R packages used in this chapter are mvtnorm and vars. Make sure these packages are installed and loaded before running the R examples in this chapter.

4.1 Stochastic Processes

A discrete-time stochastic process or time series process {,Y1,Y2,,Yt,Yt+1,}={Yt}t=, is a sequence of random variables indexed by time t17. In most applications, the time index is a regularly spaced index representing calendar time (e.g., days, months, years, etc.) but it can also be irregularly spaced representing event time (e.g., intra-day transaction times). In modeling time series data, the ordering imposed by the time index is important because we often would like to capture the temporal relationships, if any, between the random variables in the stochastic process. In random sampling from a population, the ordering of the random variables representing the sample does not matter because they are independent.

A realization of a stochastic process with T observations is the sequence of observed data {Y1=y1,Y2=y2,,YT=yT}={yt}Tt=1. The goal of time series modeling is to describe the probabilistic behavior of the underlying stochastic process that is believed to have generated the observed data in a concise way. In addition, we want to be able to use the observed sample to estimate important characteristics of a time series model such as measures of time dependence. In order to do this, we need to make a number of assumptions regarding the joint behavior of the random variables in the stochastic process such that we may treat the stochastic process in much the same way as we treat a random sample from a given population.

4.1.1 Stationary stochastic processes

We often describe random sampling from a population as a sequence of independent, and identically distributed (iid) random variables X1,X2 such that each Xi is described by the same probability distribution FX, and write XiFX. With a time series process, we would like to preserve the identical distribution assumption but we do not want to impose the restriction that each random variable in the sequence is independent of all of the other variables. In many contexts, we would expect some dependence between random variables close together in time (e.g, X1, and X2) but little or no dependence between random variables far apart in time (e.g., X1 and X100). We can allow for this type of behavior using the concepts of stationarity and ergodicity.

We start with the definition of strict stationarity.

Definition 4.1 (Strict stationarity)

A stochastic process {Yt} is strictly stationary if, for any given finite integer r and for any set of subscripts t1,t2,,tr the joint distribution of (Yt1,Yt2,,Ytr) depends only on t1t,t2t,,trt but not on t. In other words, the joint distribution of (Yt1,Yt2,,Ytr) is the same as the joint distribution of (Yt1t,Yt2t,,Ytrt) for any value of t.

In simple terms, the joint distribution of random variables in a strictly stationary stochastic process is time invariant. For example, the joint distribution of (Y1,Y5,Y7) is the same as the distribution of (Y12,Y16,Y18). Just like in an iid sample, in a strictly stationary process all of the individual random variables Yt (t=,,) have the same marginal distribution FY. This means they all have the same mean, variance etc., assuming these quantities exist. However, assuming strict stationarity does not make any assumption about the correlations between Yt,Yt1,,Ytr other than that the correlation between Yt and Ytr only depends on ttr (the time between Yt and Ytr) and not on t. That is, strict stationarity allows for general temporal dependence between the random variables in the stochastic process.

A useful property of strict stationarity is that it is preserved under general transformations, as summarized in the following proposition.

Proposition 4.1 Let {Yt} be strictly stationary and let g() be any function of the elements in {Yt}. Then {g(Yt)}, is also strictly stationary.

For example, if {Yt} is strictly stationary then {Y2t} and {YtYt1} are also strictly stationary.

The following are some simple examples of strictly stationary processes.

Example 4.1 (iid sequence)

If {Yt} is an iid sequence, then it is strictly stationary.

Example 4.2 (Non iid sequence)

Let {Yt} be an iid sequence and let XN(0,1) independent of {Yt}. Define Zt=Yt+X. The sequence {Zt} is not an independent sequence (because of the common X) but is an identically distributed sequence and is strictly stationary.

Strict stationarity places very strong restrictions on the behavior of a time series. A related concept that imposes weaker restrictions and is convenient for time series model building is covariance stationarity (sometimes called weak stationarity).

Definition 4.2 (Covariance stationarity)

A stochastic process {Yt} is covariance stationary if

  1. E[Yt]=μ< does not depend on t
  2. var(Yt)=σ2< does not depend on t
  3. cov(Yt,Ytj)=γj<, and depends only on j but not on t for j=0,1,2,

The term γj is called the jth order autocovariance. The jth order autocorrelation is defined as: ρj=cov(Yt,Ytj)var(Yt)var(Ytj)=γjσ2.

The autocovariances, γj, measure the direction of linear dependence between Yt and Ytj. The autocorrelations, ρj, measure both the direction and strength of linear dependence between Yt and Ytj. With covariance stationarity, instead of assuming the entire joint distribution of a collection of random variables is time invariant we make a weaker assumption that only the mean, variance and autocovariances of the random variables are time invariant. A strictly stationary stochastic process {Yt} such that μ, σ2, and γij exist is a covariance stationary stochastic process. However, a covariance stationary process need not be strictly stationary.

The autocovariances and autocorrelations are measures of the linear temporal dependence in a covariance stationary stochastic process. A graphical summary of this temporal dependence is given by the plot of ρj against j, and is called the autocorrelation function (ACF). Figure 4.1 illustrates an ACF for a hypothetical covariance stationary time series with ρj=(0.9)j for j=1,2,,10 created with

rho = 0.9 
rhoVec = (rho)^(1:10) 
ts.plot(rhoVec, type="h", lwd=2, col="blue", xlab="Lag j", 
        ylab=expression(rho[j]))
ACF for time series with $\rho_{j}=(0.9)^{j}$

Figure 4.1: ACF for time series with ρj=(0.9)j

For this process the strength of linear time dependence decays toward zero geometrically fast as j increases.

The definition of covariance stationarity requires that E[Yt]< and var(Yt)<. That is, E[Yt] and var(Yt) must exist and be finite numbers. This is true if Yt is normally distributed. However, it is not true if, for example, Yt has a Student’s t distribution with one degree of freedom.18 Hence, a strictly stationary stochastic process {Yt} where the (marginal) pdf of Yt (for all t) has very fat tails may not be covariance stationary.

Example 4.3 (Gaussian White Noise)

Let Ytiid N(0,σ2). Then {Yt} is called a Gaussian white noise (GWN) process and is denoted YtGWN(0,σ2). Notice that: E[Yt]=0 independent of t,var(Yt)=σ2 independent of t,cov(Yt,Ytj)=0 (for j>0) independent of t for all j, so that {Yt} satisfies the properties of a covariance stationary process. The defining characteristic of a GWN process is the lack of any predictable pattern over time in the realized values of the process. The term white noise comes from the electrical engineering literature and represents the absence of any signal.19

Simulating observations from a GWN process in R is easy: just simulate iid observations from a normal distribution. For example, to simulate T=250 observations from the GWN(0,1) process use:

set.seed(123)
y = rnorm(250)

The simulated iid N(0,1) values are generated using the rnorm() function. The command set.seed(123) initializes R’s internal random number generator using the seed value 123. Every time the random number generator seed is set to a particular value, the random number generator produces the same set of random numbers. This allows different people to create the same set of random numbers so that results are reproducible. The simulated data is illustrated in Figure 4.2 created using:

ts.plot(y,main="Gaussian White Noise Process",xlab="time",
        ylab="y(t)", col="blue", lwd=2)
abline(h=0)
Realization of a GWN(0,1) process.

Figure 4.2: Realization of a GWN(0,1) process.

The function ts.plot() creates a time series line plot with a dummy time index. An equivalent plot can be created using the generic plot() function with optional argument type="l". The data in Figure 4.2 fluctuate randomly about the mean value zero and exhibit a constant volatility of one (typical magnitude of a fluctuation about zero). There is no visual evidence of any predictable pattern in the data.

Example 4.4 (GWN model for continuously compounded returns)

Let rt denote the continuously compounded monthly return on Microsoft stock and assume that rtiidN(0.01,(0.05)2). We can represent this distribution in terms of a GWN process as follows rt=0.01+εt,εtGWN(0,(0.05)2). Here, rt is constructed as a GWN(0,σ2) process plus a constant. Hence, {rt} is a GWN process with a non-zero mean: rtGWN(0.01,(0.05)2). T=60 simulated values of {rt} are computed using:

set.seed(123)
y = rnorm(60, mean=0.01, sd=0.05)
ts.plot(y,main="GWN Process for Monthly Continuously Compounded Returns",
        xlab="time",ylab="r(t)", col="blue", lwd=2)
abline(h=c(0,0.01,-0.04,0.06), lwd=2, 
       lty=c("solid","solid","dotted","dotted"), 
       col=c("black", "red", "red", "red"))
Simulated returns from GWN(0.01,(0.05)$^{2})$.

Figure 4.3: Simulated returns from GWN(0.01,(0.05)2).

and are illustrated in Figure 4.3. Notice that the returns fluctuate around the mean value of 0.01 (solid red line) and the size of a typical deviation from the mean is about 0.05. The red dotted lines show the values 0.1±0.05 .

An implication of the GWN assumption for monthly returns is that non-overlapping multi-period returns are also GWN. For example, consider the two-month return rt(2)=rt+rt1. The non-overlapping process {rt(2)}={...,rt2(2),rt(2),rt+2(2),...} is GWN with mean E[rt(2)]=2μ=0.02, variance var(rt(2))=2σ2=0.005, and standard deviation sd(rt(2))=2σ=0.071.

Example 4.5 (Independent white noise)

Let Ytiid (0,σ2). Then {Yt} is called an independent white noise (IWN) process and is denoted YtIWN(0,σ2). The difference between GWN and IWN is that with IWN we don’t specify that all random variables are normally distributed. The random variables can have any distribution with mean zero and variance σ2. To illustrate, suppose Yt=13×t3 where t3 denotes a Student’s t distribution with 3 degrees of freedom. This process has E[Yt]=0 and var(Yt)=1. Figure 4.4 shows simulated observations from this process created using the R commands

set.seed(123) 
y = (1/sqrt(3))*rt(250, df=3) 
ts.plot(y, main="Independent White Noise Process", xlab="time", ylab="y(t)",         
        col="blue", lwd=2) 
abline(h=0)
Simulation of IWN(0,1) process: $Y_{t}\sim\frac{1}{\sqrt{3}}\times t_{3}$

Figure 4.4: Simulation of IWN(0,1) process: Yt13×t3

The simulated IWN process resembles the GWN in Figure 4.4 but has more extreme observations.

Example 4.6 (Weak white noise)

Let {Yt} be a sequence of uncorrelated random variables each with mean zero and variance σ2. Then {Yt} is called a weak white noise (WWN) process and is denoted YtWWN(0,σ2). With a WWN process, the random variables are not independent, only uncorrelated. This allows for potential non-linear temporal dependence between the random variables in the process.

4.1.2 Non-Stationary processes

In a covariance stationary stochastic process it is assumed that the means, variances and autocovariances are independent of time. In a non-stationary process, one or more of these assumptions is not true. The following examples illustrate some typical non-stationary time series processes.

Example 4.7 (Deterministically trending process)

Suppose {Yt} is generated according to the deterministically trending process: Yt=β0+β1t+εt, εtGWN(0,σ2ε),t=0,1,2, Then {Yt} is nonstationary because the mean of Yt depends on t: E[Yt]=β0+β1t. Figure 4.5 shows a realization of this process with β0=0,β1=0.1 and σ2ε=1 created using the R commands:

set.seed(123)
e = rnorm(250)
y.dt = 0.1*seq(1,250) + e
ts.plot(y.dt, lwd=2, col="blue", main="Deterministic Trend + Noise")
abline(a=0, b=0.1)
Deterministically trending nonstationary process $Y_{t}=0.1\times t+\varepsilon_{t},\varepsilon_{t}\sim\mathrm{GWN}(0,1)$

Figure 4.5: Deterministically trending nonstationary process Yt=0.1×t+εt,εtGWN(0,1)

Here the non-stationarity is created by the deterministic trend β0+β1t in the data. The non-stationary process {Yt} can be transformed into a stationary process by simply subtracting off the trend: Xt=Ytβ0β1t=εtGWN(0,σ2ε). The detrended process XtGWN(0,σ2ε) is obviously covariance stationary.

Example 4.8 (Random walk)

A random walk (RW) process {Yt} is defined as: Yt=Yt1+εt, εtGWN(0,σ2ε),Y0 is fixed (non-random). By recursive substitution starting at t=1, we have: Y1=Y0+ε1,Y2=Y1+ε2=Y0+ε1+ε2,Yt=Yt1+εt=Y0+ε1++εt=Y0+tj=1εj. Now, E[Yt]=Y0 which is independent of t. However, var(Yt)=var(tj=1εj)=tj=1σ2ε=σ2ε×t, which depends on t, and so {Yt} is not stationary.

Figure 4.6 shows a realization of the RW process with Y0=0 and σ2ε=1 created using the R commands:

set.seed(321)
e = rnorm(250)
y.rw = cumsum(e)
ts.plot(y.rw, lwd=2, col="blue", main="Random Walk")
abline(h=0)
Random walk process: $Y_{t}=Y_{t-1}+\varepsilon_{t},\varepsilon_{t}\sim\mathrm{GWN}(0,1)$.

Figure 4.6: Random walk process: Yt=Yt1+εt,εtGWN(0,1).

The RW process looks much different from the GWN process in Figure 4.2. As the variance of the process increases linearly with time, the uncertainty about where the process will be at a given point in time increases with time.

Although {Yt} is non-stationary, a simple first-differencing transformation, however, yields a covariance stationary process: Xt=YtYt1=εtGWN(0,σ2ε).

Example 4.9 (Random walk with drift model for log stock prices)

Let rt denote the continuously compounded monthly return on Microsoft stock and assume that rtGWN(μ,σ2). Since rt=ln(Pt/Pt1) it follows that lnPt=lnPt1+rt. Now, re-express rt as rt=μ+εt where εtGWN(0,σ2). Then lnPt=lnPt1+μ+εt. By recursive substitution we have lnPt=lnP0+μt+tt=1εt and so lnPt follows a random walk process with drift value μ. Here, E[lnPt]=μt and var(lnPt)=σ2t so lnPt is non-stationary because both the mean and variance depend on t. In this model, prices, however, do not follow a random walk since Pt=elnPt=Pt1ert.

4.1.3 Ergodicity

In a strictly stationary or covariance stationary stochastic process no assumption is made about the strength of dependence between random variables in the sequence. For example, in a covariance stationary stochastic process it is possible that ρ1=cor(Yt,Yt1)=ρ100=cor(Yt,Yt100)=0.5, say. However, in many contexts it is reasonable to assume that the strength of dependence between random variables in a stochastic process diminishes the farther apart they become. That is, ρ1>ρ2 and that eventually ρj=0 for j large enough. This diminishing dependence assumption is captured by the concept of ergodicity.

Definition 4.3 (Ergodicity (intuitive definition))

Intuitively, a stochastic process {Yt} is ergodic if any two collections of random variables partitioned far apart in the sequence are essentially independent.

The formal definition of ergodicity is highly technical and requires advanced concepts in probability theory. However, the intuitive definition captures the essence of the concept. The stochastic process {Yt} is ergodic if Yt and Ytj are essentially independent if j is large enough.

If a stochastic process {Yt} is covariance stationary and ergodic then strong restrictions are placed on the joint behavior of the elements in the sequence and on the type of temporal dependence allowed.

Example 4.10 (White noise processes)

If {Yt} is GWN or IWN then it is both covariance stationary and ergodic.

Example 4.11 (Covariance stationary but not ergodic process (White 1984, page 41))

Let YtGWN(0,1) and let XN(0,1) independent of {Yt}. Define Zt=Yt+X. Then {Zt} is covariance stationary but not ergodic. To see why {Zt} is not ergodic, note that for all j>0: var(Zt)=var(Yt+X)=1+1=2,γj=cov(Yt+X,Ytj+X)=cov(Yt,Ytj)+cov(Yt,X)+cov(Ytj,X)+cov(X,X)=cov(X,X)=var(X)=1,ρj=12 for all j. Hence, the correlation between random variables separated far apart does not eventually go to zero and so {Zt} cannot be ergodic.

4.2 Multivariate Time Series

Consider n time series variables {Y1t},,{Ynt}. A multivariate time series is the (n×1) vector time series {Yt} where the ith row of {Yt} is {Yit}. That is, for any time t, Yt=(Y1t,,Ynt). Multivariate time series analysis is used when one wants to model and explain the interactions and co-movements among a group of time series variables. In finance, multivariate time series analysis is used to model systems of asset returns, asset prices, exchange rates, the term structure of interest rates, and economic variables, etc.. Many of the time series concepts described previously for univariate time series carry over to multivariate time series in a natural way. Additionally, there are some important time series concepts that are particular to multivariate time series. The following sections give the details of these extensions.

4.2.1 Stationary and ergodic multivariate time series

A multivariate time series {Yt} is covariance stationary and ergodic if all of its component time series are stationary and ergodic. The mean of Yt is defined as the (n×1) vector E[Yt]=(μ1,,μn)=μ, where μi=E[Yit] for i=1,,n. The variance/covariance matrix of Yt is the (n×n) matrix var(Yt)=Σ=E[(Ytμ)(Ytμ)]=(var(Y1t)cov(Y1t,Y2t)cov(Y1t,Ynt)cov(Y2t,Y1t)var(Y2t)cov(Y2t,Ynt)cov(Ynt,Y1t)cov(Ynt,Y2t)var(Ynt)). The matrix Σ has elements σij= cov(Yit,Yjt) which measure the contemporaneous linear dependence between Yit and Yjt that is time invariant. The correlation matrix of Yt is the (n×n) matrix cor(Yt)=C0=D1Γ0D1, where D is an (n×n) diagonal matrix with jth diagonal element σj=sd(Yjt).

4.2.1.1 Cross covariance and correlation matrices

For a univariate time series {Yt}, the autocovariances, γk, and autocorrelations, ρk, summarize the linear time dependence in the data. With a multivariate time series {Yt} each component has autocovariances and autocorrelations but there are also cross lead-lag covariances and correlations between all possible pairs of components. The lag k autocovariances and autocorrelations of Yjt, for j=1,,n, are defined as γkjj=cov(Yjt,Yjtk),ρkjj=corr(Yjt,Yjtk)=γkjjσ2j, and these are symmetric in k: γkjj=γkjj, ρkjj=ρkjj. The cross lag-k covariances and cross lag-k correlations between Yit and Yjt are defined as γkij=cov(Yit,Yjtk),ρkij=corr(Yjt,Yjtk)=γkijσ2iσ2j, and they are not necessarily symmetric in k. In general, γkij=cov(Yit,Yjtk)cov(Yjt,Yitk)=γkji. If γkij0 for some k>0 then Yjt is said to lead Yit. This implies that past values of Yjt are useful for predicting future values of Yit. Similarly, if γkji0 for some k>0 then Yit is said to lead Yjt. It is possible that Yit leads Yjt and vice-versa. In this case, there is said to be dynamic feedback between the two series.

All of the lag k cross covariances and correlations are summarized in the (n×n) lag k cross covariance and lag k cross correlation matrices Γk=E[(Ytμ)(Ytkμ)]=(cov(Y1t,Y1tk)cov(Y1t,Y2tk)cov(Y1t,Yntk)cov(Y2t,Y1tk)cov(Y2t,Y2tk)cov(Y2t,Yntk)cov(Ynt,Y1tk)cov(Ynt,Y2tk)cov(Ynt,Yntk)),Ck=D1ΓkD1. The matrices Γk and Ck are not symmetric in k but it is easy to show that Γk=Γk and Ck=Ck.

Example 4.12 (Multivariate Gaussian white noise processes)

Let {Yt} be an n×1 vector time series process. If YtiidN(0,Σ) then {Yt} is called multivariate Gaussian white noise and is denoted YtGWN(0,Σ). Notice that E[Yt]=0,var(Yt)=Σ,cov(Yjt,Yjtk)=γkjj=0(fork>0)cov(Yit,Yjtk)=γkij=0(fork>0) Hence, the elements of {Yt} are contemporaneously correlated but exhibit no time dependence. That is, each element of Yt exhibits no time dependence and there is no dynamic feedback between any two elements. Simulating observations from GWN(0,Σ) requires simulating from a multivariate normal distribution, which can be done using the mvtnorm function rmvnorm(). For example, to simulate and plot T=250 observation from a bivariate GWN(0,Σ) process with Σ=(4111)C=(10.50.51) use:

library(mvtnorm) 
Sigma = matrix(c(4, 1, 1, 1), 2, 2) 
set.seed(123) 
Y = rmvnorm(250, sigma=Sigma) 
colnames(Y) = c("Y1", "Y2") 
ts.plot(Y, lwd=2, col=c("black", "blue")) 
abline(h=0)
legend("topleft", legend=c("Y1", "Y2"), 
       lwd=2, col=c("black", "blue"), lty=1)
Simulated bivariate GWN process.

Figure 4.7: Simulated bivariate GWN process.

The simulated values are shown on the same plot in Figure 4.7. Both series fluctuate randomly about zero, and the first series (black line) has larger fluctuations (volatility) than the second series (blue line). The two series are contemporaneously correlated (ρ12=0.5) but are both uncorrelated over time (ρk11=ρk22=0,k>0) and are not cross-lag correlated (ρk12=ρk21=0,k>0).

4.3 Time Series Models

Time series models are probability models that are used to describe the behavior of a stochastic process. In many cases of interest, it is assumed that the stochastic process to be modeled is covariance stationary and ergodic. Then, the main feature of the process to be modeled is the time dependence between the random variables. In this section, we illustrate some simple models for covariance stationary and ergodic time series that exhibit particular types of linear time dependence captured by autocorrelations. The univariate models, made popular originally by (Box and Jenkins 1976), are called autoregressive moving average (ARMA) models. The multivariate model, made popular by (Sims 1980), is called the vector autoregressive (VAR) model. These models are used extensively in economics and finance for modeling univariate and multivariate time series.

4.3.1 Moving average models

Moving average models are simple covariance stationary and ergodic time series models built from linear functions of GWN that can capture time dependence between random variables that lasts only for a finite number of lags.

4.3.1.1 MA(1) Model

Suppose you want to create a covariance stationary and ergodic stochastic process {Yt} in which Yt and Yt1 are correlated but Yt and Ytj are not correlated for j>1. That is, the time dependence in the process only lasts for one period. Such a process can be created using the first order moving average (MA(1)) model: Yt=μ+εt+θεt1, 1<θ<1,εtGWN(0,σ2ε). The MA(1) model is a simple linear function of the GWN random variables εt and εt1. This linear structure allows for easy analysis of the model. The moving average parameter θ determines the sign and magnitude of the correlation between Yt and Yt1. Clearly, if θ=0 then Yt=μ+εt so that {Yt} is GWN with non-zero mean μ and exhibits no time dependence. As will be shown below, the MA(1) model produces a covariance stationary and ergodic process for any (finite) value of θ. The restriction 1<θ<1 is called the invertibility restriction and will be explained below.

To verify that (4.2) process is a covariance stationary process we must show that the mean, variance and autocovariances are time invariant. For the mean, we have: E[Yt]=μ+E[εt]+θE[εt1]=μ, because E[εt]=E[εt1]=0.

For the variance, we have var(Yt)=σ2=E[(Ytμ)2]=E[(εt+θεt1)2]=E[ε2t]+2θE[εtεt1]+θ2E[ε2t1]=σ2ε+0+θ2σ2ε=σ2ε(1+θ2). The term E[εtεt1]=cov(εt,εt1)=0 because {εt} is an independent process.

For γ1=cov(Yt,Yt1), we have: cov(Yt,Yt1)=E[(Ytμ)(Yt1μ)]=E[(εt+θεt1)(εt1+θεt2)]=E[εtεt1]+θE[εtεt2]+θE[ε2t1]+θ2E[εt1εt2]=0+0+θσ2ε+0=θσ2ε. Here, the sign of γ1 is the same as the sign of θ.

For ρ1=cor(Yt,Yt1) we have: ρ1=γ1σ2=θσ2εσ2ε(1+θ2)=θ(1+θ2). Clearly, ρ1=0 if θ=0; ρ1>0 if θ>0;ρ1<0 if θ<0. Also, the largest value for |ρ1| is 0.5 which occurs when |θ|=1. Hence, a MA(1) model cannot describe a stochastic process that has |ρ1|>0.5. Also, note that there is more than one value of θ that produces the same value of ρ1. For example, θ and 1/θ give the same value for ρ1. The invertibility restriction 1<θ<1 provides a unique mapping between θ and ρ1.

For γ2=cov(Yt,Yt2), we have:

cov(Yt,Yt2)=E[(Ytμ)(Yt2μ)]=E[(εt+θεt1)(εt2+θεt3)]=E[εtεt2]+θE[εtεt3]+θE[εt1εt2]+θ2E[εt1εt3]=0+0+0+0=0.

Similar calculations can be used to show that cov(Yt,Ytj)=γj=0 for j>1. Hence, for j>1 we have ρj=0 and there is only time dependence between Yt and Yt1 but no time dependence between Yt and Ytj for j>1. Because ρj=0 for j>1 the MA(1) process is trivially ergodic.

Example 4.13 (Simulating values from MA(1) process)

Consider simulating T=250 observations from (4.2) with μ=1, θ=0.9 and σε=1. When simulating an MA(1) process, you need to decide how to start the simulation. The value of Yt at t=0, y0, is called the initial value and is the starting value for the simulation. Now, the first two observations from (4.2) starting at t=0 are y0=μ+ε0+θε1,y1=μ+ε1+θε0. It is common practice is to set ε1=ε0=0 so that y0=μ, y1=μ+ε1=y0+ε1 and ε1 is the first simulated error term. The remaining observations for t=2,,T are created from (4.2). We can implement the simulation in a number of ways in R. The most straightforward way is to use a simple loop:

n.obs = 250 
mu = 1 
theta = 0.9 
sigma.e = 1 
set.seed(123) 
e = rnorm(n.obs, sd = sigma.e) 
y = rep(0, n.obs) 
y[1] = mu + e[1] 
for (i in 2:n.obs) {   
    y[i] = mu + e[i] + theta*e[i-1] 
}
head(y, n=3)
## [1] 0.4395 0.2654 2.3515

The “for loop” in R can be slow, however, especially for a very large number of simulations. The simulation can be more efficiently implemented using vectorized calculations as illustrated below:

set.seed(123) 
e = rnorm(n.obs, sd = sigma.e) 
em1 = c(0, e[1:(n.obs-1)]) 
y = mu + e + theta*em1 
head(y, n=3)
## [1] 0.4395 0.2654 2.3515

The vectorized calculation avoids looping all together and computes all of the simulated values at the same time. This can be considerably faster than the “for loop” calculation.

The MA(1) model is a special case of the more general autoregressive integrated moving average (ARIMA) model. R has many built-in functions and several packages for working with ARIMA models. In particular, the R function arima.sim() can be used to simulate observations from a MA(1) process. It essentially implements the simulation loop described above. The arguments of arima.sim() are:

args(arima.sim)
## function (model, n, rand.gen = rnorm, innov = rand.gen(n, ...), 
##     n.start = NA, start.innov = rand.gen(n.start, ...), ...) 
## NULL

where model is a list with named components describing the ARIMA model parameters (excluding the mean value), n is the number of simulated observations, rand.gen specifies the pdf for εt, innov is a vector εt values of length n, n.start is the number of pre-simulation (burn-in) values for εt, start.innov is a vector of n.start pre-simulation values for εt, and ... specify any additional arguments for rand.gen. For example, to perform the same simulations as above use:

ma1.model = list(ma=0.9)
set.seed(123)
y = mu + arima.sim(model=ma1.model, n=250, 
                   n.start=1, start.innov=0) 
head(y, n=3)
## [1] 0.4395 0.2654 2.3515

The ma component of the "list" object ma1.model specifies the value of θ for the MA(1) model, and is used as an input to the function arima.sim(). The options n.start = 1 and start.innov = 0 sets the start-up initial value ε0=0. By default, arima.sim() sets μ=0, specifies εtGWN(0,1), and returns εt+θεt1 for t=1,,T. The simulated value for Yt is constructed by adding the value of mu (μ=1) to the output of arima.sim().

The function ARMAacf() can be used to compute the theoretical autocorrelations, ρj, from the MA(1) model (recall, ρ1=θ/(1+θ2) and ρj=0 for j>1). For example, to compute ρj for j=1,,10 use:

ma1.acf = ARMAacf(ar=0, ma=0.9, lag.max=10)
ma1.acf
##      0      1      2      3      4      5      6      7      8      9 
## 1.0000 0.4972 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 
##     10 
## 0.0000

Figure 4.8 shows the simulated data and the theoretical ACF created using:

par(mfrow=c(2,1))
ts.plot(y,main="MA(1) Process: mu=1, theta=0.9",
xlab="time",ylab="y(t)", col="blue", lwd=2)
abline(h=c(0,1))
plot(0:10, ma1.acf,type="h", col="blue", lwd=2,
main="ACF for MA(1): theta=0.9",xlab="lag",ylab="rho(j)")
abline(h=0)
Simulated values and theoretical ACF from MA(1) process with $\mu=1$, $\theta=0.9$ and $\sigma_{\varepsilon}^{2}=1$.

Figure 4.8: Simulated values and theoretical ACF from MA(1) process with μ=1, θ=0.9 and σ2ε=1.

par(mfrow=c(1,1))

Compared to the GWN process in 4.2, the MA(1) process is a bit smoother in its appearance. This is due to the positive one-period time dependence captured by ρ1=0.4972.

Example 4.14 (MA(1) model for overlapping continuously compounded returns)

Let Rt denote the one-month continuously compounded return and assume that: Rt GWN(μ,σ2). Consider creating a monthly time series of two-month continuously compounded returns using: Rt(2)=Rt+Rt1. The time series of these two-month returns, observed monthly, overlap by one month: Rt(2)=Rt+Rt1,Rt1(2)=Rt1+Rt2,Rt2(2)=Rt2+Rt3, The one-month overlap in the two-month returns implies that {Rt(2)} follows an MA(1) process. To show this, we need to show that the autocovariances of {Rt(2)} behave like the autocovariances of an MA(1) process.

To verify that {Rt(2)} follows an MA(1) process, first we have: E[Rt(2)]=E[Rt]+E[Rt1]=2μ,var(Rt(2))=var(Rt+Rt1)=2σ2. Next, we have: cov(Rt(2),Rt1(2))=cov(Rt+Rt1,Rt1+Rt2)=cov(Rt1,Rt1)=var(Rt1)=σ2, and, cov(Rt(2),Rt2(2))=cov(Rt+Rt1,Rt2+Rt3)=0,cov(Rt(2),Rtj(2))=0 for j>1. Hence, the autocovariances of {Rt(2)} are those of an MA(1) process.

Notice that ρ1=σ22σ2=12. What MA(1) process describes {Rt(2)}? Because ρ1=θ1+θ2=0.5 it follows that θ=1. Hence, the MA(1) process has mean 2μ and θ=1 and can be expressed as the MA(1) model: Rt(2)=2μ+εt+εt1,εtGWN(0,σ2).

Notice that this is a non-invertible MA(1) model.

4.3.1.2 MA(q) Model

The MA(q) model has the form Yt=μ+εt+θ1εt1++θqεtq, where εtGWN(0,σ2ε). The MA(q) model is stationary and ergodic provided θ1,,θq are finite. The moments of the MA(q) (see end-of-chapter exercises) are E[Yt]=μ,γ0=σ2(1+θ21++θ2q),γj={(θj+θj+1θ1+θj+2θ2++θqθqj)σ2 for j=1,2,,q0 for j>q. Hence, the ACF of an MA(q) is non-zero up to lag q and is zero afterward.

Example 4.15 (Overlapping returns and MA(q) models)

MA(q) models often arise in finance through data aggregation transformations. For example, let Rt=ln(Pt/Pt1) denote the monthly continuously compounded return on an asset with price Pt. Define the annual return at time t using monthly returns as Rt(12)=ln(Pt/Pt12)=11j=0Rtj. Suppose RtGWN(μ,σ2) and consider a sample of monthly returns of size T, {R1,R2,,RT}. A sample of annual returns may be created using overlapping or non-overlapping returns. Let {R12(12),R13(12), ,RT(12)} denote a sample of T=T11 monthly overlapping annual returns and {R12(12),R24(12),,RT(12)} denote a sample of T/12 non-overlapping annual returns. Researchers often use overlapping returns in analysis due to the apparent larger sample size. One must be careful using overlapping returns because the monthly annual return sequence {Rt(12)} is not a Gaussian white noise process even if the monthly return sequence {Rt} is. To see this, straightforward calculations give: E[Rt(12)]=12μ,γ0=var(Rt(12))=12σ2,γj=cov(Rt(12),Rtj(12))=(12j)σ2 for j<12,γj=0 for j12. Since γj=0 for j12 notice that {Rt(12)} behaves like an MA(11) process: Rt(12)=12μ+εt+θ1εt1++θ11εt11,εtGWN(0,σ2).

4.3.2 Autoregressive Models

Moving average models can capture almost any kind of autocorrelation structure. However, this may require many moving average terms in (4.3). Another type of simple time series model is the autoregressive model. This model can capture complex autocorrelation patterns with a small number of parameters and is used more often in practice than the moving average model.

4.3.2.1 AR(1) Model

Suppose you want to create a covariance stationary and ergodic stochastic process {Yt} in which Yt and Yt1 are correlated, Yt and Yt2 are slightly less correlated, Yt and Yt3 are even less correlated and eventually Yt and Ytj are uncorrelated for j large enough. That is, the time dependence in the process decays to zero as the random variables in the process get farther and farther apart. Such a process can be created using the first order autoregressive (AR(1)) model: Ytμ=ϕ(Yt1μ)+εt, 1<ϕ<1εtiid N(0,σ2ε) It can be shown that the AR(1) model is covariance stationary and ergodic provided 1<ϕ<1. We will show that the AR(1) process has the following properties: E[Yt]=μ,var(Yt)=σ2=σ2ε/(1ϕ2),cov(Yt,Yt1)=γ1=σ2ϕ,cor(Yt,Yt1)=ρ1=γ1/σ2=ϕ,cov(Yt,Ytj)=γj=σ2ϕj,cor(Yt,Ytj)=ρj=γj/σ2=ϕj. Notice that the restriction |ϕ|<1 implies that: lim so that Y_{t} is essentially independent of Y_{t-j} for large j and so \{Y_{t}\} is ergodic. For example, if \phi=0.5 then \rho_{10}=(0.5)^{10}=0.001; if \phi=0.9 then \rho_{10}=(0.9)^{10}=0.349. Hence, the closer \phi is to unity the stronger is the time dependence in the process. If \phi=1, then (4.4) becomes the random walk model Y_{t}=Y_{t-1}+\varepsilon_{t} and is a non-stationary process.

Verifying covariance stationarity for the AR(1) model is more involved than for the MA(1) model, and establishing the properties (4.5) - (4.10) involves some tricks. In what follows, we will assume that \{Y_{t}\} is a covariance stationary process and that |\phi|<1. First, consider the derivation for (4.5). We have: \begin{align*} E[Y_{t}] & =\mu+\phi(E[Y_{t-1}]-\mu)+E[\varepsilon_{t}]\\ & =\mu+\phi E[Y_{t-1}]-\phi\mu. \end{align*} Here, we use the first trick. Given that \{Y_{t}\} is covariance stationary it follows that E[Y_{t}]=E[Y_{t-1}]. Substituting E[Y_{t}]=E[Y_{t-1}] into the above and solving for E[Y_{t}] gives (4.5).

A similar trick can be used to derive (4.6): \mathrm{var}(Y_{t})=\phi^{2}(\mathrm{var}(Y_{t-1}))+\mathrm{var}(\varepsilon_{t})=\phi^{2}(\mathrm{var}(Y_{t}))+\sigma_{\varepsilon}^{2}, which uses the fact that Y_{t-1} is independent of \varepsilon_{t} (because Y_{t-1} only depends on t-1 values) and \mathrm{var}(Y_{t})=\mathrm{var}(Y_{t-1}) given that \{Y_{t}\} is covariance stationary. Solving for \sigma^{2}=\mathrm{var}(Y_{t}) gives (4.6).

To determine (4.7), we use another trick. Multiply both sides of (4.4) by Y_{t-1}-\mu and take expectations to give: \gamma_{1}=E\left[\left(Y_{t}-\mu\right)\left(Y_{t-1}-\mu\right)\right]=\phi E\left[(Y_{t-1}-\mu)^{2}\right]+E\left[\varepsilon_{t}\left(Y_{t-1}-\mu\right)\right]=\phi\sigma^{2}, which uses the fact that Y_{t-1} is independent of \varepsilon_{t}, and \mathrm{var}(Y_{t})=\mathrm{var}(Y_{t-1})=\sigma^{2}. Finally, to determine (4.9), multiply both sides of (4.4) by Y_{t-j}-\mu and take expectations to give: \begin{align*} \gamma_{j} & =E\left[\left(Y_{t}-\mu\right)\left(Y_{t-j}-\mu\right)\right]=\phi E\left[(Y_{t-1}-\mu)(Y_{t-j}-\mu)\right]+E\left[\varepsilon_{t}\left(Y_{t-j}-\mu\right)\right]\\ & =\phi\gamma_{j-1}, \end{align*} which uses the fact that Y_{t-j} is independent of \varepsilon_{t}, and E\left[(Y_{t-1}-\mu)(Y_{t-j}-\mu)\right]=\gamma_{j-1} provided \{Y_{t}\} is covariance stationary. Using recursive substitution and \gamma_{0}=\sigma^{2} gives (4.9).

The AR(1) model (4.4) is written in what is called the mean-adjusted form. The mean-adjusted form can be re-expressed in the form of a linear regression model as follows: \begin{align} Y_{t}-\mu & =\phi(Y_{t-1}-\mu)+\varepsilon_{t}\Rightarrow\\ Y_{t} & =\mu-\phi\mu+\phi Y_{t-1}+\varepsilon_{t}\\ & =c+\phi Y_{t-1}+\varepsilon_{t},\tag{4.11} \end{align} where c=(1-\phi)\mu\Rightarrow\mu=c/(1-\phi) is the intercept of the linear regression. This regression model form is convenient for estimation by ordinary least squares.

Example 4.16 (Simulating values from AR(1) process)

Consider simulating 250 observations from (4.4) with \mu=1, \phi=0.9 and \sigma_{\varepsilon}=1. To start the simulation, an initial value or start-up value for Y_{0} is required. A commonly used initial value is the mean value \mu so that Y_{1}=\mu+\varepsilon_{1}. As with the MA(1) model, this can be performed using a simple “for loop” in R:

phi = 0.9 
mu = 1 
sigma.e = 1 
n.obs = 250 
y = rep(0, n.obs)
set.seed(123) 
e = rnorm(n.obs, sd=sigma.e) 
y[1] = mu + e[1]  
for (i in 2:n.obs) {
     y[i] = mu + phi*(y[i-1] - mu) + e[i] 
} 
head(y, 3)
## [1] 0.4395 0.2654 1.8976

Unfortunately, there is no easy way to vectorize the loop calculation. However, the R function filter(), with optional argument method = "recursive", implements the AR(1) recursion efficiently in C code and so is more efficient than the for loop code in R above:

y = mu + stats::filter(e, phi, method="recursive") 
head(y, 3)
## [1] 0.4395 0.2654 1.8976

The R function arima.sim(), which internally uses the filter() function, can also be used to simulate observations from an AR(1) process. For the AR(1) model, the function arima.sim() simulates the components form of the AR(1) model \begin{eqnarray*} Y_{t} & = & \mu+u_{t,}\\ u_{t} & = & \phi u_{t-1}+\epsilon_{t}. \end{eqnarray*} Hence, to replicate the “for loop” simulation with arima.sim() use:

ar1.model = list(ar=0.9)
mu = 1
set.seed(123)
y = mu + arima.sim(model=ar1.model,n=250,n.start=1, start.innov=0)
head(y, 3)
## [1] 0.4395 0.2654 1.8976

The R function ARMAacf() can be used to compute the theoretical ACF for an AR(1) model as follows

ar1.acf = ARMAacf(ar = 0.9, ma = 0, lag.max = 10)

The simulated AR(1) values and the ACF are shown in Figure 4.9. Compared to the MA(1) process in Figure 4.8, the realizations from the AR(1) process are much smoother. That is, when Y_{t} wanders high above its mean it tends to stay above the mean for a while and when it wanders low below the mean it tends to stay below for a while.

\blacksquare

Simulated values and ACF from AR(1) model with $\mu=1,\phi=0.9$ and $\sigma_{\varepsilon}^{2}=1$

Figure 4.9: Simulated values and ACF from AR(1) model with \mu=1,\phi=0.9 and \sigma_{\varepsilon}^{2}=1

Example 4.17 (AR(1) models and the speed of mean reversion)
  • insert example showing AR(1) models with different values of \rho
  • discuss the concept of mean reversion
  • discuss RW model as special case of AR(1)

\blacksquare

4.3.2.2 AR(p) Model

The covariance stationary AR(p) model in mean-adjusted form is \begin{align} Y_{t}-\mu & =\phi_{1}(Y_{t-1}-\mu)+\cdots+\phi_{p}(Y_{t-p}-\mu)+\varepsilon_{t},\tag{4.12}\\ & \varepsilon_{t}\sim\mathrm{GWN}(0,\sigma_{\varepsilon}^{2}),\nonumber \end{align} where \mu=E[Y_{t}]. Like the AR(1), restrictions on the autoregressive parameters \phi_{1},\ldots,\phi_{p} are required for \{Y_{t}\} to be covariance stationary and ergodic. A detailed treatment of these restrictions is beyond the scope of this book. However, one simple necessary condition for \{Y_{t}\} to be covariance stationary is |\phi|<1 where \phi=\phi_{1}+\cdots+\phi_{p}. Hence, in the AR(p) model the sum of the autoregressive components \phi has a similar interpretation as the single autoregressive coefficient in the AR(1) model.

The regression form of the AR(p) is Y_{t}=c+\phi_{1}Y_{t-1}+\cdots+\phi_{p}Y_{t-p}+\varepsilon_{t}, where c=\mu/(1-\phi_{1}-\cdots-\phi_{p})=\mu/(1-\phi). This form is convenient for estimation purposes because it is in the form of a linear regression.

The regression form of the AR(p) model is used very often in practice because of its simple linear structure and because it can capture a wide variety of autocorrelation patterns such as exponential decay, damped cyclical patterns, and oscillating damped cyclical patterns. Unfortunately, the mathematical derivation of the autocorrelations in the AR(p) model is complicated and tedious (and beyond the scope of this book). The exercises at the end of the chapter illustrate some of the calculations for the AR(2) model.

4.3.3 Autoregressive Moving Average Models

Autoregressive and moving average models can be combined into a general model called the autoregressive moving average (ARMA) model. The ARMA model with p autoregressive components and q moving average components, denoted ARMA(p,q) is given by \begin{align} Y_{t}-\mu & =\phi_{1}(Y_{t-1}-\mu)+\cdots+\phi_{p}(Y_{t-p}-\mu) \nonumber \\ & +\varepsilon_{t}+\theta_{1}\varepsilon_{t-1}+\cdots+\theta_{q}\varepsilon_{t-q} \tag{4.13} \\ \varepsilon_{t} & \sim\mathrm{GWN}(0,\sigma^{2}) \nonumber \end{align} The regression formulation is Y_{t}=c+\phi_{1}Y_{t-1}+\cdots+\phi_{p}Y_{t-p}+\varepsilon_{t}+\theta\varepsilon_{t-1}+\cdots+\theta\varepsilon_{t-q} where c=\mu/(1-\phi_{1}-\cdots-\phi_{p})=\mu/(1-\phi) and \phi=\phi_{1}+\cdots+\phi_{p}. This model combines aspects of the pure moving average models and the pure autoregressive models and can capture many types of autocorrelation patterns. For modeling typical non-seasonal economic and financial data, it is seldom necessary to consider models in which p>2 and q>2. For example, the simple ARMA(1,1) model

\begin{equation} Y_{t}-\mu = \phi_{1}(Y_{t-1}-\mu) + \varepsilon_{t}+\theta_{1}\varepsilon_{t-1} \tag{4.14} \end{equation}

can capture many realistic autocorrelations observed in data.

4.3.4 Vector Autoregressive Models

The most popular multivariate time series model is the (VAR) model. The VAR model is a multivariate extension of the univariate autoregressive model (4.12). For example, a bivariate VAR(1) model for \mathbf{Y}_{t}=(Y_{1t},Y_{2t})^{\prime} has the form \left(\begin{array}{c} Y_{1t}\\ Y_{2t} \end{array}\right)=\left(\begin{array}{c} c_{1}\\ c_{2} \end{array}\right)+\left(\begin{array}{cc} a_{11}^{1} & a_{12}^{1}\\ a_{21}^{1} & a_{22}^{1} \end{array}\right)\left(\begin{array}{c} Y_{1t-1}\\ Y_{2t-1} \end{array}\right)+\left(\begin{array}{c} \varepsilon_{1t}\\ \varepsilon_{2t} \end{array}\right), or \begin{align*} Y_{1t} & =c_{1}+a_{11}^{1}Y_{1t-1}+a_{12}^{1}Y_{2t-1}+\varepsilon_{1t},\\ Y_{2t} & =c_{2}+a_{21}^{1}Y_{1t-1}+a_{22}^{1}Y_{2t-1}+\varepsilon_{2t}, \end{align*} where \left(\begin{array}{c} \varepsilon_{1t}\\ \varepsilon_{2t} \end{array}\right)\sim\mathrm{iid}\text{ }N\left(\left(\begin{array}{c} 0\\ 0 \end{array}\right),\left(\begin{array}{cc} \sigma_{11} & \sigma_{12}\\ \sigma_{12} & \sigma_{22} \end{array}\right)\right). In the equations for Y_{1} and Y_{2}, the lagged values of both Y_{1} and Y_{2} are present. Hence, the VAR(1) model allows for dynamic feedback between Y_{1} and Y_{2} and can capture cross-lag correlations between the variables. In matrix notation, the model is \begin{eqnarray*} \mathbf{Y}_{t} & = & \mathbf{A}\mathbf{Y}_{t-1}+\mathbf{\varepsilon}_{t},\\ \mathbf{\varepsilon}_{t} & \sim & N(\mathbf{0},\,\Sigma), \end{eqnarray*} where \mathbf{A}=\left(\begin{array}{cc} a_{11}^{1} & a_{12}^{1}\\ a_{21}^{1} & a_{22}^{1} \end{array}\right),\,\Sigma=\left(\begin{array}{cc} \sigma_{11} & \sigma_{12}\\ \sigma_{12} & \sigma_{22} \end{array}\right).

The general VAR(p) model for \mathbf{Y}_{t}=(Y_{1t},Y_{2t},\ldots,Y_{nt})^{\prime} has the form \mathbf{Y}_{t}=\mathbf{c+A}_{1}\mathbf{Y}_{t-1}+\mathbf{A}_{2}\mathbf{Y}_{t-2}+\cdots+\mathbf{A}_{p}\mathbf{Y}_{t-p}+\mathbf{\varepsilon}_{t}, where \mathbf{A}_{i} are (n\times n) coefficient matrices and \mathbf{\varepsilon}_{t} is an (n\times1) unobservable zero mean white noise vector process with covariance matrix \Sigma. VAR models are capable of capturing much of the complicated dynamics observed in stationary multivariate time series.

Example 4.18 (Simulated values from a bivariate VAR(1) process)

To be completed

4.4 Forecasting

  • One of the main practical uses of time series models is for forecasting future observations
  • The existence of time dependence in a covariance stationary time series means that we can exploit this time dependence to obtain forecasts of future observations that are superior to the unconditional mean.
  • Describe basic forecasting problem
  • Show result that conditional mean is optimal mse forecast
  • Show chain-rule of forecasting for AR(1) processes

4.5 Further Reading: Time Series Concepts

This chapter gives a very brief introduction to time series modeling. More thorough treatments of time series analysis with an orientation towards economics and finance with examples in R are given in (Ruppert and Matteson 2015), (Tsay 2010), and (Zivot 2016). The CRAN task view for Time Series is an excellent summary of R packages used for time series analysis.

4.6 Problems: Time Series Concepts

4.6.1 Exercise 4.1

Suppose the time series \left\{ X_{t}\right\} _{t=-\infty}^{\infty} is independent white noise. That is X_{t}\sim i.i.d.\,(0,\sigma^{2}). Define two new time series \left\{ Y_{t}\right\} _{t=-\infty}^{\infty} and \left\{ Z_{t}\right\} _{t=-\infty}^{\infty}, where Y_{t}=X_{t}^{2} and Z_{t}=|X_{t}|. Are \left\{ Y_{t}\right\} _{t=-\infty}^{\infty} and \left\{ Z_{t}\right\} _{t=-\infty}^{\infty} also independent white noise processes? Why or why not?

4.6.2 Exercise 4.2

Realizations from four stochastic processes are given in Figure . Which processes appear to be covariance stationary and which processes appear to be non-stationary? Briefly justify your answers.

4.6.3 Exercise 4.3

Consider the MA(1) model \begin{eqnarray*} Y_{t} & = & 0.05+\varepsilon_{t}+\theta\varepsilon_{t-1},\,-1<\theta<1\\ \varepsilon_{t} & \sim & iid\,N(0,(0.10)^{2}). \end{eqnarray*} This process has mean E[Y_{t}]=0.05.

  1. Calculate \mathrm{var}(Y_{t}) and \rho_{1}=\mathrm{cor}(Y_{t},Y_{t-1}) for \theta=0.5 and \theta=0.9.
  2. Using the R function arima.sim(), simulate and plot 250 observations of the MA(1) process with \theta=0.5 and \theta=0.9 . Briefly comment on the behavior of the simulated data series. Does it look covariance stationary? Does it show evidence of time dependence?

4.6.4 Exercise 4.4

Consider the AR(1) model \begin{eqnarray*} Y_{t}-0.05 & =\phi(Y_{t-1}-0.05)+\varepsilon_{t},\,-1<\phi<1\\ & \varepsilon_{t}\sim iid\,N(0,(0.10)^{2}). \end{eqnarray*} This process has mean E[Y_{t}]=0.05.

  1. Calculate \mathrm{var}(Y_{t}) for \phi=0.5 and \phi=0.9.
  2. Calculate \rho_{j}=\mathrm{cor}(Y_{t},Y_{t-j}) for \phi=0.5 and \phi=0.9 and for j=1,\ldots,5.
  3. Using the R function arima.sim(), simulate and plot 250 observations of the AR(1) process with \theta=0.5 and \theta=0.9 . Briefly comment on the behavior of the simulated data series. Does it look covariance stationary? Does it show evidence of time dependence? How is it different from the MA(1) process

4.6.5 Exercise 4.5

Figure shows a realization of a stochastic process representing a monthly time series of overlapping 2-month continuously compounded returns r_{t}(2)=r_{t}+r_{t-1}, where the 1-month continuously compounded returns {r_{t}} follow a Gaussian White noise process with variance 1.

  1. Based on the sample autocorrelations, which time series process is most appropriate for describing the series: MA(1) or AR(1)? Justify your answer.
  2. If you think the process is an AR(1) process, what do you think is the value of the autoregressive parameter? If you think the process is a MA(1) process, what do you think is the value of the moving average parameter?

4.6.6 Exercise 4.6

Let {Y_t} represent a stochastic process. Under what conditions is {Y_t} covariance stationary?

Realizations from four stochastic processes are given in the Figures below:

Which processes appear to be covariance stationary and which processes appear to be non-stationary? For those processes that you think are non-stationary, explain why the process is non-stationary.

Consider the following model:

Y_t = 10 - 0.67 Y_{t-1} + \epsilon_t, \,\,\,\, \epsilon \sim N(0, 1)

  • Is it stationary? Why or why not?

  • Find the mean and the variance of this process.

4.7 Solutions to Selected Problems

Exercise 4.6 Let {Y_t} represent a stochastic process. Under what conditions is {Y_t} covariance stationary?

Realizations from four stochastic processes are given in the Figures below:

  1. Which processes appear to be covariance stationary and which processes appear to be non-stationary?

The only process which appears to be covariance stationary is Process 1 (constant mean, volatility etc.)

For those processes that you think are non-stationary, explain why the process is non-stationary.

Process 2 has an obvious time trend so the mean is not independet of t. Process 3 has a level shift around observation 75 (the mean shifts up) so that the mean before t=75 is different from the mean after t=75. Process 4 shows an increase in variance/volatility after observation 75. The variance/volatility before t=75 is different from the variance/volatility after t=75.

  1. Consider the following model:

Y_t = 10 - 0.67 Y_{t-1} + \epsilon_t, \,\,\,\, \epsilon \sim N(0, 1)

  • Is it stationary? Why or why not?

Stationary. The absolute value of the coefficient of Y_{t-1} is 0.67, which is smaller than 1.

  • Find the mean and the variance of this process.

Mean: 10/(1 + 0.67) = 5.99

Variance: 1/(1 - 0.67^2) = 1.8146

References

Box, G., and G. M. Jenkins. 1976. Time Series Analysis : Forecasting and Control. San Francisco: Holden-Day.

Ruppert, D., and D. S. Matteson. 2015. Statistics and Data Analysis for Financial Engineering with R Examples. New York: Springer.

Sims, C. A. 1980. Macroeconomics and Reality. Econometrica.

Tsay, R. 2010. Analysis of Financial Time Serie. Wiley.

Zivot, E. 2016. Modeling Financial Time Series with R. New York: Springer.


  1. To conserve on notation, we will represent the stochastic process \{Y_{t}\}_{t=-\infty}^{\infty} simply as \{Y_{t}\}.↩︎

  2. This is also called a Cauchy distribution. For this distribution E[Y_{t}]=\mathrm{var}(Y_{t})=\mathrm{cov}(Y_{t},Y_{t-j})=\infty.↩︎

  3. As an example of white noise, think of tuning an AM radio. In between stations there is no signal and all you hear is static. This is white noise.↩︎