Kinematic Kalman Filter
A 2D Kalman filter tracking price and velocity to reduce lag in trends.
Usage
Optimized for trend-following strategies where lag reduction is critical. q_pos controls price sensitivity, q_vel controls momentum sensitivity, and r controls overall smoothing.
Background
The Kinematic Kalman Filter extends the 1D model by incorporating a velocity state. This allows the filter to 'anticipate' the next price based on current momentum, providing a zero-lag-like response during strong trends while maintaining smoothness via its optimal error-correction logic.
Parameters
q_pos(default: 0.001): Process noise for position (price)q_vel(default: 0.0001): Process noise for velocity (momentum)r(default: 0.1): Measurement noise (smoothing strength)
Formula
[ \hat{x}{k|k-1} = \Phi \hat{x} ] [ P_{k|k-1} = \Phi P_{k-1|k-1} \Phi^T + Q ] [ K_k = P_{k|k-1} H^T (H P_{k|k-1} H^T + R)^{-1} ] [ \hat{x}{k|k} = \hat{x}} + K_k (z_k - H \hat{x{k|k-1}) ] [ P ]} = (I - K_k H) P_{k|k-1