# Noise-Triggered Latent Rank Adaptation `experiment.py` implements a small rank controller using an exponentially weighted covariance estimate, explicit isotropic noise subtraction, ordered eigenvalues, persistence `M`, and hysteretic on/off thresholds. `switched_rank_demo` applies the controller to a stream whose latent order is 2, then 5, then 2. ## Run ```bash /home/maxwelhelp/main/bin/python3 experiment.py ``` Results are written to `results.json`. ## Quantitative checks 1. **Spectral boundary:** with signal variance ratio `q` and noise variance 1, corrected population eigenvalue is `q`; the predicted activation boundary is `q > c_on = 2`. The deterministic sweep transitions between `q=2.0` and `q=2.1`, exactly confirming the strict threshold. A finite noisy sweep gives a softer 50% transition near 1.7 because the EWMA estimate and random samples fluctuate. 2. **EWMA adaptation delay:** for `alpha=0.1`, old total variance 1.2, new total variance 6, and threshold total variance 3, the analytic first crossing is 7 updates. Thirty noisy trials produce median 6 and mean 6.5 updates. 3. **Hysteresis:** near threshold, hysteresis (`c_on=2`, `c_off=1.2`) gives 105 toggles versus 179 for the single-threshold comparison, a 41.3% reduction. The reconstruction demo obtains mean active ranks 1.98, 4.87, and 2.07 in the three segments. Adaptive MSE is 0.0896, versus 0.3072 for fixed rank 2 and 0.1232 for fixed rank 5 in this deliberately simple observation/reconstruction benchmark.