Skip to content

simulate_hierarchy: a volatility multiplier common to every subject and node - #157

Merged
jeremymanning merged 1 commit into
masterfrom
common-volatility
Nov 25, 2026
Merged

jeremymanning merged 1 commit into
masterfrom
common-volatility

Conversation

@jeremymanning

Copy link
Copy Markdown
Member

What changes

tc.simulate_hierarchy(..., volatility=sd, volatility_tau=50) multiplies every series of every subject by one positive series v(t):

  • log v is Gaussian-smoothed white noise (standard deviation volatility_tau samples) with standard deviation sd; the mean of v**2 is 1.
  • v is drawn after every other draw, so at the same seed the data are exactly those of the call without volatility times v, and every other entry of truth is the same.
  • truth["volatility"] holds v (ones by default).
  • The 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 times v for every combination of shared, signs and factors; the standard deviation of log v and the mean of v**2; the autocorrelation of log 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 -W clean. The slow tests were not run locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DcKtyroRyyp5UK7L9zwqxL

… 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
@jeremymanning
jeremymanning merged commit 384b9d7 into master Nov 25, 2026
6 checks passed
@jeremymanning
jeremymanning deleted the common-volatility branch November 25, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant