statsmodels.tsa.statespace.kalman_filter.KalmanFilter.set_filter_method

KalmanFilter.set_filter_method(filter_method=None, **kwargs)[source]

Set the filtering method

The filtering method controls aspects of which Kalman filtering approach will be used.

Parameters:

filter_method : integer, optional

Bitmask value to set the filter method to. See notes for details.

**kwargs

Keyword arguments may be used to influence the filter method by setting individual boolean flags. See notes for details.

Notes

The filtering method is defined by a collection of boolean flags, and is internally stored as a bitmask. Only one method is currently available:

FILTER_CONVENTIONAL = 0x01
Conventional Kalman filter.

If the bitmask is set directly via the filter_method argument, then the full method must be provided.

If keyword arguments are used to set individual boolean flags, then the lowercase of the method must be used as an argument name, and the value is the desired value of the boolean flag (True or False).

Note that the filter method may also be specified by directly modifying the class attributes which are defined similarly to the keyword arguments.

The default filtering method is FILTER_CONVENTIONAL.

Examples

>>> mod = sm.tsa.statespace.SARIMAX(range(10))
>>> mod.ssm.filter_method
1
>>> mod.ssm.filter_conventional
True
>>> mod.ssm.filter_univariate = True
>>> mod.ssm.filter_method
17
>>> mod.ssm.set_filter_method(filter_univariate=False,
...                           filter_collapsed=True)
>>> mod.ssm.filter_method
33
>>> mod.ssm.set_filter_method(filter_method=1)
>>> mod.ssm.filter_conventional
True
>>> mod.ssm.filter_univariate
False
>>> mod.ssm.filter_collapsed
False
>>> mod.ssm.filter_univariate = True
>>> mod.ssm.filter_method
17