Discrete Kalman State-Space Filtering, Joseph Covariance Stability & Ornstein-Uhlenbeck Half-Life
Separating latent trend velocity from microstructure bid-ask bounce requires state-space estimators that adapt innovation gain cleanly without losing matrix positive-definiteness across 86,400 daily 1-second ticks. Below is the exact kinematic Kalman recursion and Ornstein-Uhlenbeck transition algebra implemented in Destiny Trader.
1. Kinematic Level-Velocity State-Space Recursion
Modeling latent log-price level and drift velocity x_k = [p_k, v_k]^T under transition matrix F = [[1, dt], [0, 1]], observation vector H = [1, 0], continuous white-acceleration process noise Q, and microstructure observation variance R separates trend extrapolation from innovation shrinkage:
x_(k|k-1) = F * x_(k-1|k-1), P_(k|k-1) = F * P_(k-1|k-1) * F^T + Q
y_tilde_k = z_k - H * x_(k|k-1), S_k = H * P_(k|k-1) * H^T + R
K_k = P_(k|k-1) * H^T / S_k, x_(k|k) = x_(k|k-1) + K_k * y_tilde_k2. Joseph Positive-Semidefinite Covariance Update & Robbins-Monro Noise Adaptation
To prevent roundoff asymmetry over multi-day streaming sessions, covariance updates use the symmetric Joseph quadratic form alongside exponentially weighted innovation-matching for observation noise R_k:
A_k = I - K_k * H
P_(k|k) = A_k * P_(k|k-1) * A_k^T + K_k * R_k * K_k^T // Guaranteed symmetric PSD
P_(k|k) = 0.5 * (P_(k|k) + P_(k|k)^T) // Exact bit-level symmetrization3. Exact Discrete Transition of Ornstein-Uhlenbeck Spreads
For stationary spread or basis residuals governed by dX_t = theta * (mu - X_t) dt + sigma dW_t (theta > 0), exact Ito integration across step dt yields X_(k+1) = mu * (1 - exp(-theta * dt)) + exp(-theta * dt) * X_k + eps_k with Var(eps_k) = (sigma^2 / (2 * theta)) * (1 - exp(-2 * theta * dt)), yielding exact half-life t_(1/2) = -dt * ln(2) / ln(phi_hat) whenever 0 < phi_hat < 1.
4. Live 1-Second Trend & Microstructure Streams
Inspect live 1-second BTC-USD and SOL-USD trajectories below, or toggle the full Kalman + EMA Ribbon overlay inside /trade.
Link quantitative notebooks and market research repositories directly to live 1-second Supercharts.
Kalman Filtering & Ornstein-Uhlenbeck Half-Life — FAQ
Direct answers on velocity-extrapolated phase reduction, Joseph covariance stability, exact AR(1) half-life mapping, and analytical scope.
- Why does a 2-state local-linear-trend Kalman filter reduce phase lag relative to an N-bar SMA or EMA?
- Single-pole exponential moving averages model latent price as a driftless random walk, forcing high smoothing factors to lag sustained velocity ramps by (1 - alpha) / alpha bars. Tracking both latent level p_k and instantaneous velocity v_k in state vector x_k = [p_k, v_k]^T extrapolates deterministic drift p_(k-1) + v_(k-1) * dt during prediction before applying innovation gain K_k.
- Why use Joseph-form covariance updates instead of the textbook P = (I - K * H) * P_pred formula?
- In IEEE-754 floating-point arithmetic over tens of thousands of 1-second ticks, subtracting K_k * H * P_pred directly can lose symmetry and produce small negative eigenvalues when measurement noise R is much smaller than prior variance. Joseph form P_k = (I - K_k * H) * P_pred * (I - K_k * H)^T + K_k * R * K_k^T sums two symmetric positive-semidefinite outer products.
- How is the continuous-time Ornstein-Uhlenbeck half-life estimated without continuous-time discretization bias?
- Exact integration of dX_t = theta * (mu - X_t) dt + sigma dW_t over step dt yields AR(1) transition X_(k+1) = c + phi * X_k + eps_k with exact mapping phi = exp(-theta * dt), not 1 - theta * dt. Thus theta = -ln(phi) / dt and mean-reversion half-life is t_(1/2) = ln(2) / theta = -dt * ln(2) / ln(phi).
- Does Kalman or Ornstein-Uhlenbeck analytics in Destiny constitute trading or investment advice?
- No. Under Lowe v. SEC (472 U.S. 181), CSA NI 31-103, and CFTC Rule 4.41, Destiny provides impersonal signal-processing and statistical charting software strictly for informational and educational study.