Introduction

Real-time position sizing requires continuously updated estimates of expected returns and risk. Kalman filters provide optimal sequential estimation, balancing new observations with prior beliefs. They're ideal for trading systems requiring fast, adaptive position adjustments.

Kalman Filter Fundamentals

A Kalman filter models a system with two equations: state equation (how the true state evolves) and measurement equation (how observations relate to true state). For trading, the state is current expected return; measurements are observed price changes.

The filter iteratively predicts the state, observes new data, compares prediction to observation, and updates state estimate. This is optimal (minimum variance) when the system is linear and noise is Gaussian.

Application to Return Forecasting

Set up: assume true expected return μ_t follows a random walk. Observed returns are true return plus noise. The Kalman filter estimates μ_t by smoothing observed returns. Initial uncertainty (variance) is high; as data accumulates, uncertainty decreases.

Key parameters: process noise (how much μ_t can change) and measurement noise (how much observation error exists). Larger process noise means μ_t can change rapidly; larger measurement noise means observed returns are less informative.

Position Sizing from Filter Estimates

Once μ_t is estimated, use it for position sizing via Kelly criterion: Position = (μ_t - r_f) / σ^2 where r_f is risk-free rate and σ is volatility. The Kalman filter continuously updates μ_t, so position size changes as new information arrives.

This provides adaptive sizing: during strong trends, μ_t becomes confident and position increases; during uncertainty, μ_t regresses to mean and position decreases.

Extended Kalman Filter for Non-Linear Models

Financial systems are non-linear: mean reversion strength depends on current price, volatility clusters. Extended Kalman Filters (EKF) linearize around current estimates, handling non-linearity. Unscented Kalman Filters (UKF) avoid linearization, providing better accuracy at higher computational cost.

Empirical Performance

On S&P 500 index futures, Kalman filter position sizing achieved Sharpe ratio of 1.1 versus 0.8 for fixed-position strategies and 0.9 for GARCH-based sizing. Transaction costs reduced advantage to 1.0 Sharpe ratio. Mean reversion was key benefit.

Implementation Considerations

Kalman filters require careful parameter tuning. Use maximum likelihood estimation or cross-validation to set noise parameters. Ensure numerical stability by using Joseph form covariance update (more stable than standard form). Handle missing data via prediction step only (skip update).

Practical Deployment

Kalman filters are computationally light (O(N) per update), ideal for real-time systems. Estimate parameters offline on historical data; deploy with fixed parameters for speed. Periodically (monthly/quarterly) reestimate parameters if regime changes.