« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Time Series and Stochastic Differential Equations
Perform Autoregressive Filtering
Filter data using an autoregressive Kalman filter.
In[1]:=
X
SeedRandom[99]; data = RandomFunction[ARMAProcess[{.1}, {.6}, 1], {1, 50}];
Fit an autoregressive model to the data using
EstimatedProcess
.
In[2]:=
X
ar = EstimatedProcess[data, ARProcess[3]]
Out[2]=
Filter the data according to the estimated process using
KalmanFilter
.
In[3]:=
X
arFilter = KalmanFilter[ar, data]
Out[3]=
Compare the data and the filter.
In[4]:=
X
ListLinePlot[{data, arFilter}, Filling -> {1 -> {2}}, FillingStyle -> Yellow, PlotLegends -> {"Data", "Filter"}, ImageSize -> 400]
Out[4]=