feat(result): warn when simulation may not have reached equilibrium#9
Merged
feat(result): warn when simulation may not have reached equilibrium#9
Conversation
Add is_equilibrated property to SimulationResult that checks whether R(t) has stabilized in the final 10% of time steps. Display a warning in both CLI output and web interface when the simulation appears to still be evolving. This helps catch a common pitfall when comparing distributions with very different characteristic time scales at the same mean transmissibility — the slower distribution may need a larger t_max to reach equilibrium.
327b142 to
de439c0
Compare
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
Adds an
is_equilibratedproperty toSimulationResultand a CLI warning when R(t) is still changing at the end of a simulation.Why
When comparing distributions with the same mean transmissibility T̄ but very different characteristic time scales (e.g., Exponential vs Gamma(5) with scale=1), the slower distribution may need a significantly larger
t_maxto reach equilibrium. Without a warning, this produces misleading results — e.g., R∞=0.278 for Gamma(5) vs R∞=0.803 for Exponential at the same T̄=0.2, when the true equilibrium R∞ is ~0.80 for both.This was found during a replication study of Böttcher & Antulov-Fantulin (2020).
How
SimulationResult.is_equilibrated: compares R(t) over its final 10% of time steps. ReturnsFalseif delta > 0.01.display_result_statistics(): shows a warning suggesting--t-maxincrease when not equilibrated.Impact