Official Python implementation and reproduction suite for the paper:
A Cubic-Decay Recursive Kurtosis-Aware Kalman Filter for State Estimation under Structurally Masked Impulsive Disturbances
Ahmed Sattar Jabbar* and Haifa Taha Abd Ahmed
Department of Statistics, College of Administration and Economics, Mustansiriyah University, Baghdad, Iraq.
Recursive higher-order moment estimation in Kalman filtering has historically been hindered by an intrinsic transient instability. When estimating the fourth central moment
the recursive sample kurtosis ratio is:
Following an impulsive shock, the denominator variance dissipates at rate
This creates a spurious exponential divergence (The Kurtosis Ratio Paradox), causing false alarms to explode long after the disturbance has ceased.
We analytically resolve this paradox by introducing a cubic forgetting factor schedule (
Under this formulation, the homogeneous post-shock decay rate of the kurtosis ratio becomes:
For an arbitrary decay exponent
-
$p < 2$ (e.g., standard linear EWMA$p=1$ ): Negative damping$\lambda^{-(2-p)t} \to \infty$ (spurious divergence / instability). -
$p = 2$ : Zero damping$\lambda^0 = 1$ (permanent memory lock). -
$p \ge 3$ : Positive exponential damping$\lambda^{(p-2)t}$ . -
$p = 3$ is the minimal integer exponent that guarantees asymptotic post-shock stability while exactly harmonizing higher-order forgetting dynamics with first-order linear filter recovery ($\lambda^t$ ).
Standard Kalman filter diagnostic monitors rely on second-order statistics (e.g., Normalized Innovation Squared or moving-window variance). We mathematically prove (Proposition 1) that a Cauchy-Laplace-Gaussian (CLG) mixture with dynamic mixing weight
Because total innovation variance remains strictly bounded below energy thresholds, conventional second-order detectors fail to trigger, allowing stealth impulsive corruption to directly degrade state estimates.
- Fourth-Order Anomaly Detection: Bypasses structural blindness with zero historical observation buffer overhead.
-
Cubic Decay Principle: Guarantees post-shock stability and unbiased asymptotic moments
$\mathbb{E}[\mu_4^*] = \mathbb{E}[\nu^4]$ . -
Automated Gain Revocation: Inflates
$R_k$ exponentially upon kurtosis breach, forcing$K_k \to 0$ and provably bounding single-step estimation errors (Theorem 1). - Asymptotic Snap-back: Restores nominal Kalman Gain smoothly upon anomaly cessation without step discontinuities.
-
$\mathcal{O}(d^3)$ Computational Complexity: Preserves the standard Kalman filter complexity with only$\mathcal{O}(1)$ scalar arithmetic overhead and a four-scalar state footprint.
RKAKF/
├── rkakf/ # Core Python Package
│ ├── __init__.py # Public package interface
│ ├── filters.py # RKAKF, Standard KF, Huber KF, VB Student-t, PF
│ ├── distributions.py # CLG mixture, truncated Cauchy, Laplace samplers
│ └── metrics.py # RMSE, MAE, Peak Error, TTR, Wilcoxon test
├── scripts/ # Extended Benchmarks & Reproduction Scripts
│ ├── multivariate_6d_drone_benchmark.py # 6D drone kinematics & nonlinear EKF tracking
│ └── reproduce_exact_figures.py # Generates 300 DPI exact paper publication figures
├── tests/ # Formal Mathematical Verification Tests
│ └── test_rkakf.py # Unit tests validating Prop 1, Prop 2, Cor 1, Thm 1
├── figures/ # Output directory for generated publication plots
├── run_experiments.py # Modular CLI experiment runner
├── reproduce_all_experiments.py # Complete monolithic reproduction suite (EXP 1-10)
├── requirements.txt # Python package dependencies
├── pyproject.toml # Standard Python packaging (PEP 517/621)
├── LICENSE # MIT License
└── README.md # Repository documentation
Clone the repository and install dependencies:
git clone https://github.com/amjed-droid/RKAKF.git
cd RKAKF
pip install -r requirements.txtOr install in editable mode:
pip install -e .import numpy as np
from rkakf import RKAKF, generate_CLG
# 1. Instantiate RKAKF
filter = RKAKF(F=1.0, H=1.0, Q=0.01, R_nom=0.10, kappa_th=4.0)
# 2. Simulate streaming measurements with an impulsive outlier
measurements = [0.1, -0.05, 0.08, 250.0, 0.02, -0.04] # outlier at k=3
for k, y_k in enumerate(measurements):
x_est, kappa, R_k, K_k = filter.step(y_k)
print(f"Step {k:d} | Meas: {y_k:6.2f} | Est: {x_est:5.3f} | Kurtosis: {kappa:6.2f} | Gain: {K_k:.4f}")Run the complete suite or specific experiments via the CLI runner or specialized benchmark scripts:
# Fast mode (100 Monte Carlo runs - ~5 seconds)
python run_experiments.py --all --fast
# Full mode (1000 Monte Carlo runs)
python run_experiments.py --all# EXP 1: Structural Blindness Verification (Proposition 1)
python run_experiments.py --exp 1
# EXP 2: Localized Stealth Burst Resilience (Standard KF vs RKAKF)
python run_experiments.py --exp 2
# EXP 4: Operational Boundaries (Huber KF vs RKAKF under Continuous CLG Noise)
python run_experiments.py --exp 4
# EXP 5: Large-scale Monte Carlo Analysis (1000 Runs & Wilcoxon Hypothesis Test)
python run_experiments.py --exp 5# Run complete monolithic reproduction suite (EXP 1 to EXP 10 + 2D verification)
python reproduce_all_experiments.py
# Regenerate high-resolution exact paper publication figures (300 DPI)
python scripts/reproduce_exact_figures.py
# Run 6D multivariate drone telemetry and nonlinear EKF tracking benchmark
python scripts/multivariate_6d_drone_benchmark.pyAll generated figures are saved at 300 DPI in the figures/ directory.
| Scenario | Evaluated Metric | Standard KF | Huber-Robust KF | Alternative / Baseline | RKAKF (Proposed) |
|---|---|---|---|---|---|
| Proposition 1 | Empirical Variance ( |
Diverges (if unconstrained) | Diverges | -- |
Strictly Bounded ( |
| Proposition 2 | Post-Shock Recovery | Diverges ( |
Frozen ( |
-- | Exponential Decay ($p=3, \mathcal{O}(\lambda^t)$) |
| Stealth Burst | In-Burst RMSE | 1.2144 | 0.8120 | 0.5738 (Particle Filter, ESS=1) | 0.5811 (52.1% reduction) |
| Continuous CLG | Steady-State RMSE | 1.6320 | 0.6102 | Degenerates (Particle Filter) | 0.7064 (56.7% reduction) |
| Peak Outlier | Maximum Absolute Error | 12.0048 | 1.7654 | Degenerates (Particle Filter) | 3.0247 (74.8% reduction) |
| Drone Telemetry | Flight Altitude RMSE | 0.3218 | 0.3231 (ripples) | 0.4020 ( |
0.2558 (Smooth tracking) |
| Complexity | Per-Step Scaling |
Operational Boundary Note: As transparently documented in the paper, memoryless M-estimators (Huber KF) remain optimal for continuous, stationary i.i.d. noise due to the absence of memory accumulation. The proposed RKAKF is uniquely engineered for localized, stealthy cyber-physical bursts where variance-based detectors fail.
Run the mathematical invariant unit test suite:
python -m unittest discover testsTests verify:
-
test_proposition1_structural_blindness_bounded_variance: Bounded variance under growing$M$ . -
test_proposition2_cubic_decay_resolves_kurtosis_ratio_paradox: Asymptotic dissipation vs linear divergence. -
test_theorem1_gain_revocation_bounds_outlier_error: Gain suppression and estimation error bounding. -
test_rkakf_nominal_performance_comparable_to_kf: Statistical optimality under pure Gaussian noise.
If you use RKAKF in your research or applications, please cite our paper:
@article{jabbar2026rkakf,
title = {A Cubic-Decay Recursive Kurtosis-Aware Kalman Filter for State Estimation under Structurally Masked Impulsive Disturbances},
author = {Jabbar, Ahmed Sattar and Abd Ahmed, Haifa Taha},
year = {2026},
note = {Preprint}
}This project is licensed under the MIT License - see the LICENSE file for details.