Return a smoothed temporal float or temporal point obtained by filtering a noisy trajectory with an Extended Kalman Filter
extendedKalmanFilter(tfloat, gate float, q float, variance float, to_drop boolean DEFAULT TRUE) → tfloat
extendedKalmanFilter(tgeompoint, gate float, q float, variance float, to_drop boolean DEFAULT TRUE) → tgeompoint
The filter models the underlying motion of a moving object and separates it from measurement noise and occasional outliers. The gate parameter controls how strict the outlier detection is, q is the process-noise scale, variance is the measurement-noise variance, and to_drop chooses whether outliers are removed (true) or replaced by the predicted trajectory (false).
These functions are intended for trajectories with at least three instants and are typically applied to temporal values with linear interpolation.
SELECT asEWKT(
extendedKalmanFilter(
tgeompoint '[Point(1 1)@2001-01-01,
Point(50 50)@2001-01-02,
Point(2 2)@2001-01-03]',
1e-5, 5e-10, 5e-10, true));
-- Drop mode: the outlier at 2001-01-02 is removed
SELECT asEWKT(
extendedKalmanFilter(
tgeompoint '[Point(1 1)@2001-01-01,
Point(50 50)@2001-01-02,
Point(2 2)@2001-01-03]',
1e-5, 5e-10, 5e-10, false));
-- Fill mode: the outlier is replaced by a point predicted from the surrounding motion