KalmanFilter
✖
KalmanFilter
Details

- 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.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Filter using an autoregressive model:

https://wolfram.com/xid/0fraoa1zany1m-n7vt27

Filter noise from a sample path using an ARMA model:

https://wolfram.com/xid/0fraoa1zany1m-10q7m4

https://wolfram.com/xid/0fraoa1zany1m-zn9sk5

Compare the data to the prediction:

https://wolfram.com/xid/0fraoa1zany1m-2iur6r

Scope (5)Survey of the scope of standard use cases
Use KalmanFilter with TimeSeriesModel:

https://wolfram.com/xid/0fraoa1zany1m-55ocvu


https://wolfram.com/xid/0fraoa1zany1m-c7sp48


https://wolfram.com/xid/0fraoa1zany1m-x1tik6

Compare filtering with given initial values:

https://wolfram.com/xid/0fraoa1zany1m-7lkc80
Create a sample from a weakly stationary ARMA:

https://wolfram.com/xid/0fraoa1zany1m-whpi8h
Filter using ARMA with given initial values:

https://wolfram.com/xid/0fraoa1zany1m-5wj5is

https://wolfram.com/xid/0fraoa1zany1m-bklw4

Find a filter for a multivariate model and data:

https://wolfram.com/xid/0fraoa1zany1m-kg0yo5

https://wolfram.com/xid/0fraoa1zany1m-fo6v90


https://wolfram.com/xid/0fraoa1zany1m-z0rx0y

Compare filters using autoregressive and moving-average processes:

https://wolfram.com/xid/0fraoa1zany1m-epfda4
Build an autoregressive filter:

https://wolfram.com/xid/0fraoa1zany1m-8bjcrj


https://wolfram.com/xid/0fraoa1zany1m-li9q3g

Build a moving-average filter:

https://wolfram.com/xid/0fraoa1zany1m-2di6sw


https://wolfram.com/xid/0fraoa1zany1m-usj8p9


https://wolfram.com/xid/0fraoa1zany1m-08hgfp

Find residuals for a fitted time series model:

https://wolfram.com/xid/0fraoa1zany1m-eia64k

https://wolfram.com/xid/0fraoa1zany1m-o4np0e


https://wolfram.com/xid/0fraoa1zany1m-094920

https://wolfram.com/xid/0fraoa1zany1m-zkcwwe


https://wolfram.com/xid/0fraoa1zany1m-rrgisq


https://wolfram.com/xid/0fraoa1zany1m-5ee86m


https://wolfram.com/xid/0fraoa1zany1m-rcfidn

Applications (2)Sample problems that can be solved with this function
Consider the following time series data and determine whether it is adequately modeled by a MAProcess:

https://wolfram.com/xid/0fraoa1zany1m-b5sura

https://wolfram.com/xid/0fraoa1zany1m-ei2wi8

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

https://wolfram.com/xid/0fraoa1zany1m-dpjb4i

Fit an MAProcess[3] model to the data:

https://wolfram.com/xid/0fraoa1zany1m-ewnell

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

https://wolfram.com/xid/0fraoa1zany1m-z14dkz

https://wolfram.com/xid/0fraoa1zany1m-bxwt9m

The null hypothesis of normality cannot be rejected:

https://wolfram.com/xid/0fraoa1zany1m-dzmxsx

Analyze residuals in TimeSeriesModel:

https://wolfram.com/xid/0fraoa1zany1m-f13l66

Calculate residuals from Kalman filtering:

https://wolfram.com/xid/0fraoa1zany1m-jegmks
Compare to residuals from TimeSeriesModelFit:

https://wolfram.com/xid/0fraoa1zany1m-jpmv2k

Properties & Relations (1)Properties of the function, and connections to other functions
Kalman filter creates a one-step forecast:

https://wolfram.com/xid/0fraoa1zany1m-p1x2ix

https://wolfram.com/xid/0fraoa1zany1m-19babu
Calculate one-step-ahead predictions from data parts:

https://wolfram.com/xid/0fraoa1zany1m-1w02ca

https://wolfram.com/xid/0fraoa1zany1m-hmryip

https://wolfram.com/xid/0fraoa1zany1m-k5jkng

Possible Issues (1)Common pitfalls and unexpected behavior
KalmanFilter requires the process to have all parameters numeric:

https://wolfram.com/xid/0fraoa1zany1m-46rn9m



https://wolfram.com/xid/0fraoa1zany1m-r7xin

Wolfram Research (2012), KalmanFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/KalmanFilter.html.
Text
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.
CMS
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. Wolfram Research. https://reference.wolfram.com/language/ref/KalmanFilter.html.
APA
Wolfram Language. (2012). KalmanFilter. Wolfram Language & System Documentation Center. Retrieved from 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
BibTeX
@misc{reference.wolfram_2025_kalmanfilter, author="Wolfram Research", title="{KalmanFilter}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/KalmanFilter.html}", note=[Accessed: 30-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_kalmanfilter, organization={Wolfram Research}, title={KalmanFilter}, year={2012}, url={https://reference.wolfram.com/language/ref/KalmanFilter.html}, note=[Accessed: 30-March-2025
]}