Improve stability estimator for unit-root histories - #36
Merged
Merged
Conversation
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.
Summary
Improves the optional equivalence-style sinuosity stability estimator so it remains honest on integrated, unit-root-like histories.
Changed
ldsfl/stability.pymethodoption tosinuosity_equivalence_stability(...);method="increment"the default;method="hac";tests/test_stability_estimator_method.pyincrement;Why
The previous diagnostic estimated drift with a least-squares slope and Newey-West/HAC uncertainty. That is reasonable for short-memory residuals, but the sinuosity histories we care about can behave like a slow trend plus an integrated random-walk component.
HAC standard errors are inconsistent under a unit root, so the resulting interval can be much too narrow and can overstate stability. The new default estimates drift from per-step increments. Differencing removes the unit-root component, making the uncertainty estimate more appropriate for these histories.
The previous HAC implementation remains available via
method="hac"so existing comparisons and sensitivity checks can still be run explicitly.Validation
python -m py_compile ldsfl/stability.py tests/test_stability_estimator_method.py python -m pytest tests/test_stability_estimator_method.py python -m pytest python -m run_ldsfl --base-dir . --cases 1 --max-steps 100 --no-plotsNotes
This PR changes the optional equivalence-style stability diagnostic behaviour.
It does not change the morphodynamic update algorithm, flow solvers, curvature calculation, CLI interface, GUI interface, output naming, fixture structure, or generated output format.
Because this is a diagnostic-method change, it is intentionally separate from the HAC vectorization, transfer-function validation, periodic-vs-free validation, and reproducibility-fixture PRs.