Back to models
Transformer

KalmanFilterTransformerSIMD

Vectorized Kalman Filter from simdkalman.

The Kalman Filter is an unsupervised algorithm, consisting of several mathematical equations which are used to create an estimate of the state of a process.

The Kalman Filter is typically used for denoising data, or inferring the hidden state of data.

This class is the adapter for the simdkalman package into sktime. KalmanFilterTransformerSIMD implements hidden inferred states and denoising, depending on the boolean input parameter hidden. In addition, filtering (forward pass only) and smoothing (forward and backward pass) options can be selected with the denoising parameter.

The simdkalman package is ideal for Panels where similar Kalman Filters are applied in to multiple time series. The package applies multi-dimensional matrix operations, which can be an order of magnitude faster than the non-vectorized implementations.

This version does not currently support the EM algorithm or dynamic inputs, i.e., list of matrices per time-step.

Quickstart

python
from sktime.transformations.kalman_filter import KalmanFilterTransformerSIMD

estimator = KalmanFilterTransformerSIMD(state_dim, state_transition=None, process_noise=None, measurement_noise=None, measurement_function=None, initial_state=None, initial_state_covariance=None, denoising=False, hidden=True)

Parameters(9)

state_dimint
System state feature dimension.
state_transitionnp.ndarray, optional (default=None)

of shape (state_dim, state_dim). State transition matrix, also referred to as F, is a matrix which describes the way the underlying series moves through successive time periods. Called A in simdkalman.

process_noisenp.ndarray, optional (default=None)

of shape (state_dim, state_dim). Process noise matrix, also referred to as Q, the uncertainty of the dynamic model.

measurement_noisenp.ndarray, optional (default=None)

of shape (measurement_dim, measurement_dim). Measurement noise matrix, also referred to as R, represents the uncertainty of the measurements.

measurement_functionnp.ndarray, optional (default=None)

of shape (measurement_dim, state_dim). Measurement equation matrix, also referred to as H, adjusts dimensions of measurements to match dimensions of state.

initial_statenp.ndarray, optional (default=None)

of shape (state_dim,). Initial estimated system state, also referred to as X0.

initial_state_covariancenp.ndarray, optional (default=None)

of shape (state_dim, state_dim). Initial estimated system state covariance, also referred to as P0.

denoisingbool, optional (default=False).

This parameter affects transform. If False, then transform will use a Kalman filter (forward pass only). If true, uses a Kalman smoother.

hiddenbool, optional (default=True).

This parameter affects transform. If True, then transform will be inferring hidden state. If False, returns smoothed/filtered observations (see also denoising), which always has the same dimensions as the input data, independent of the hidden state dimension.