filters data using the time series model given by tproc.


  • KalmanFilter allows data to be a list or TemporalData.
  • All the parameters in the time series model tproc must be numeric.
  • KalmanFilter output is decided by the type of the input. The first element of the output is initialized to be zero, so the length of the output agrees with the length of the input.


open allclose all

Basic Examples  (2)

Filter using an autoregressive model:

Filter noise from a sample path using an ARMA model:

Find filtered data:

Compare the data to the prediction:

Scope  (5)

Use KalmanFilter with TimeSeriesModel:

Compare filtering with given initial values:

Create a sample from a weakly stationary ARMA:

Filter using ARMA with given initial values:


Find a filter for a multivariate model and data:

Compare filters using autoregressive and moving-average processes:

Build an autoregressive filter:

Build a moving-average filter:

Compare data to the filters:

Find residuals for a fitted time series model:

Spread of residuals:

Distribution of residuals:

Applications  (2)

Consider the following time series data and determine whether it is adequately modeled by a MAProcess:

The correlation function drops off after lag 3. This is evidence of an MAProcess[3]:

Fit an MAProcess[3] model to the data:

Find the model residuals and determine whether they are normally distributed white noise:

The null hypothesis of normality cannot be rejected:

Analyze residuals in TimeSeriesModel:

Calculate residuals from Kalman filtering:

Compare to residuals from TimeSeriesModelFit:

Properties & Relations  (1)

Kalman filter creates a one-step forecast:

Find a filter for the data:

Calculate one-step-ahead predictions from data parts:

Compare the paths:

Possible Issues  (1)

KalmanFilter requires the process to have all parameters numeric:

The data can be symbolic:

Wolfram Research (2012), KalmanFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/KalmanFilter.html.


Wolfram Research (2012), KalmanFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/KalmanFilter.html.


Wolfram Language. 2012. "KalmanFilter." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KalmanFilter.html.


Wolfram Language. (2012). KalmanFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KalmanFilter.html


@misc{reference.wolfram_2024_kalmanfilter, author="Wolfram Research", title="{KalmanFilter}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/KalmanFilter.html}", note=[Accessed: 24-June-2024 ]}


@online{reference.wolfram_2024_kalmanfilter, organization={Wolfram Research}, title={KalmanFilter}, year={2012}, url={https://reference.wolfram.com/language/ref/KalmanFilter.html}, note=[Accessed: 24-June-2024 ]}