Repository navigation
simulate_hierarchy: a volatility multiplier common to every subject and node - #157
Merged
Merged
Conversation
… series volatility=sd draws one positive series v(t), log v Gaussian-smoothed white noise (volatility_tau samples) with standard deviation sd and mean(v**2) = 1, and multiplies every subject's data by it. v is drawn last, so the data at a seed are those without the option times v; truth["volatility"] holds v. The default (None) output is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyroRyyp5UK7L9zwqxL
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 changes
tc.simulate_hierarchy(..., volatility=sd, volatility_tau=50)multiplies every series of every subject by one positive seriesv(t):log vis Gaussian-smoothed white noise (standard deviationvolatility_tausamples) with standard deviationsd; the mean ofv**2is 1.vis drawn after every other draw, so at the same seed the data are exactly those of the call withoutvolatilitytimesv, and every other entry oftruthis the same.truth["volatility"]holdsv(ones by default).volatility=None) output is unchanged.Tests
New tests in
tests/test_simulate_hierarchy.py: the default call is unchanged; data equal the plain output timesvfor every combination ofshared,signsandfactors; the standard deviation oflog vand the mean ofv**2; the autocorrelation oflog v; lag-1 autocorrelation of squared values with and without the multiplier; argument errors.Local runs on this commit: 3688 passed without the slow tests, 78 docstring examples passed, Sphinx build with
-Wclean. The slow tests were not run locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01DcKtyroRyyp5UK7L9zwqxL