« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Time Series and Stochastic Differential Equations
Model Seasonal Data
Fit a
SARMAProcess
model for the hourly measurements of the temperature in August.
In[1]:=
X
data = Select[WeatherData["Champaign", "Temperature", {2012, 8}], FreeQ[#, Missing] &];
In[2]:=
X
DateListPlot[data, Filling -> Bottom, Joined -> True]
Out[2]=
Find process parameters.
In[3]:=
X
eproc = EstimatedProcess[data[[All, 2]], SARMAProcess[{}, {}, {24, {c}, {d}}, v], ProcessEstimator -> "MethodOfMoments"]
Out[3]=
Check if the process is weakly stationary.
In[4]:=
X
WeakStationarity[eproc]
Out[4]=
Compare correlation functions.
In[5]:=
X
ListPlot[CorrelationFunction[#, {100}] & /@ {eproc, data[[All, 2]]}, PlotStyle -> {PointSize[Large], PointSize[Medium]}, PlotRange -> All, PlotLegends -> Placed[{"Model", "Data"}, {Right, Top}], ImageSize -> 300]
Out[5]=