This work by Lucas Herrenbrueck is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

Stationary and non-stationary time series

n=400;
wn=Table[RandomReal[NormalDistribution[0,1]],{n+1}];

Below: two different ways to interpolate between white noise and a random walk. Left: the AR model with autoregressive parameter ρ. The series is stationary if ρ<1 (and δ=0, i.e. no deterministic trend). Right: the FI model (“fractionally integrated”, also called “long memory model”) with fractional dimension d. The series is stationary if d<0.5.

Each uses the same underlying white noise process (evaluate the previous cell to re-sample).

For ρ=d=0, the series coincide and show the underlying white noise process. For ρ=d=1, they also coincide and show a random walk. (Assuming that δ=0, absence of a deterministic trend.) For any other combination of ρ and d, they behave very differently.

For ρ=0.985 and deterministic trend δ=0.03 (left panel), the series on the left looks very similar to the random walk on the right (d=1, δ=0). This illustrates that when ρ is close to 1, even very many observations may not be enough to distinguish between a deterministic or a stochastic trend, i.e. to tell whether a series is stationary.

GraphicsGrid[{{
Manipulate[With[{psiAR=Chop@NestList[ρ#&,1,n]},
ListPlot[psiAR.NestList[PadLeft[Most[#],n+1]&,Take[wn,n+1],n]+δ Range[0,n],PlotRange->{-20,20},Joined->True,ImageSize->350,DataRange->{0,n},PlotLabel->"AR(ρ) series with trend (δ)"]
],{{ρ,0},-1,1},{{δ,0},-.05,.05},ControlPlacement->Bottom,SaveDefinitions->True,Paneled->False],
Manipulate[With[{psiLM=Chop@FoldList[#1((#2-1+d)/(#2))&,1,Range[n]]},ListPlot[psiLM.NestList[PadLeft[Most[#],n+1]&,Take[wn,n+1],n],PlotRange->{-20,20},Joined->True,ImageSize->350,DataRange->{0,n},PlotLabel->"FI(d) series"]
],{{d,0},-1,1},{{δ,0},-.05,.05,Enabled->False},ControlPlacement->Bottom,SaveDefinitions->True,Paneled->False]
}},ImageSize->770]

Manipulate[With[{psiAR=Chop@NestList[ρ#&,1,50],psiLM=Chop@FoldList[#1((#2-1+d)/(#2))&,1,Range[50]]},
ListPlot[{psiAR,psiLM},PlotRange->{If[ρ>0&&d>0,0,-1],1},Joined->True,ImageSize->350,PlotLabel->"THE ACF\nblue: AR(ρ); red: FI(d)",DataRange->{0,50}]
],{{ρ,0.8},-1,1},{{d,0.5},-1,1},ControlPlacement->Bottom,SaveDefinitions->True,Paneled->False]