Repository navigation
Bias as constant offset, random walk and bias instability - #235
Open
patrickmckeen wants to merge 1 commit into
Open
patrickmckeen wants to merge 1 commit into
patrickmckeen wants to merge 1 commit into
Conversation
Bias keeps three parts and their sum: the constant offset the device was built with, a random walk of rate std_bias that now starts at zero rather than at the offset, and a bias instability modelled as a first-order Gauss-Markov process (instability_std, instability_time), the slow wander an Allan-variance plot shows as its floor. The estimator's random-walk rate covers the instability with the usual 2 sigma^2 / tau term. A bias built the old way produces the same sequence as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A sensor's
Biashad two things: a starting value and a random-walk rate, and the walk started from the starting value. That conflates two different errors, and it leaves out a third:Biasnow keeps the three parts separately, withbiasas their sum so everything that reads or writes it keeps working:offset: thebiasgiven at construction, constant.walk: starts at zero, steps with standard deviationstd_bias · sqrt(Δt)as before.instability: a first-order Gauss-Markov process with standard deviationinstability_stdand correlation timeinstability_time(seconds), the standard stand-in for the flicker floor. It decays towards zero over the correlation time and is topped up each step so its standard deviation stays where configured, exactly for any step length.A bias built the old way (value and rate only) produces the same sequence as before. On the estimator side, the random-walk rate the filter assumes for a bias state covers the instability with the usual
2·σ²/τterm, so a filter with a random-walk bias model still tracks a bias that wanders. The same applies to actuator biases, since they share the class.This stacks on #234.
Tests
testing/test_sensors/test_bias_instability.py, 5 tests: the offset stays constant and the walk starts from it; without an instability the sequence equals the old random walk draw for draw; the instability is stationary with the configured standard deviation and lag-one correlationexp(−Δt/τ)over 40 000 steps; the estimator's rate includes the instability term; and the configuration is validated and survives sizing and copies. The full suite passes.🤖 Generated with Claude Code