statsmodels.tsa.statespace.kalman_smoother.KalmanSmoother.set_smoother_output

KalmanSmoother.set_smoother_output(smoother_output=None, **kwargs)[source]

Set the smoother output

The smoother can produce several types of results. The smoother output variable controls which are calculated and returned.

Parameters:

smoother_output : integer, optional

Bitmask value to set the smoother output to. See notes for details.

**kwargs

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

Notes

The smoother output is defined by a collection of boolean flags, and is internally stored as a bitmask. The methods available are:

SMOOTHER_STATE = 0x01
Calculate and return the smoothed states.
SMOOTHER_STATE_COV = 0x02
Calculate and return the smoothed state covariance matrices.
SMOOTHER_DISTURBANCE = 0x04
Calculate and return the smoothed state and observation disturbances.
SMOOTHER_DISTURBANCE_COV = 0x08
Calculate and return the covariance matrices for the smoothed state and observation disturbances.
SMOOTHER_ALL
Calculate and return all results.

If the bitmask is set directly via the smoother_output 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 smoother output may also be specified by directly modifying the class attributes which are defined similarly to the keyword arguments.

The default smoother output is SMOOTHER_ALL.

If performance is a concern, only those results which are needed should be specified as any results that are not specified will not be calculated. For example, if the smoother output is set to only include SMOOTHER_STATE, the smoother operates much more quickly than if all output is required.

Examples

>>> import statsmodels.tsa.statespace.kalman_smoother as ks
>>> mod = ks.KalmanSmoother(1,1)
>>> mod.smoother_output
15
>>> mod.set_smoother_output(smoother_output=0)
>>> mod.smoother_state = True
>>> mod.smoother_output
1
>>> mod.smoother_state
True