diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d6aeb29..647e6a8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 are correlated across subjects, by `e_i e_j sqrt(g_a g_b)` for nodes `i`, `j` of subjects `a`, `b`. `truth["factors"]` holds each subject's module series. The default (`"private"`) output is unchanged. +- `tc.simulate_hierarchy(..., volatility=sd, volatility_tau=50)`: every + series of every subject is multiplied by one positive series `v(t)` + (volatility clustering common to all series). `log v` is Gaussian-smoothed + white noise (standard deviation `volatility_tau` samples) with standard + deviation `sd`, and the mean of `v**2` is 1. `v` is drawn last, so at the + same seed the data are exactly those without `volatility` times `v`. + `truth["volatility"]` holds `v` (ones by default). The default (`None`) + output is unchanged. - Subject weights per feature: `tc.wisfc(subject_weights=W)` accepts `W` of shape (subjects, subjects, features), the weight of each subject in each subject's reference at each feature; in `tc.timecorr` and `tc.features` as diff --git a/CLAUDE.md b/CLAUDE.md index a514ce19..03d7752c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -67,7 +67,7 @@ python setup.py sdist bdist_wheel - **`timecorr/datasets.py`** (used as `tc.datasets`; its functions are not top-level names): `fetch(url, path, sha256=None, member=None)` (cached download through uniquely named `.part` files next to the target and an atomic replace, so concurrent calls for one target are safe; a relative path is under the cache root `cache_dir()`: `$TIMECORR_DATA`, default `~/timecorr_data`; a cached file is checked against `sha256` on every call), `story_listening(n_nodes=100, return_nodes=False)` (HTFA node weights of the story-listening data, `pieman/pieman_posterior_K700.mat`; intact participants, nodes varying in every participant, farthest-point selection; `n_nodes` outside 1..679, the nodes that vary in every participant, raises `ValueError`; `return_nodes=True` adds a dict with `centers`, `widths`, `index`, `varying`, `total`) and `industry_returns(start, end)` (log returns of the 49 Industry Portfolios, `french/49_Industry_Portfolios_daily_CSV.zip`; `attrs` has the file's first line, `"header"`, and the count of missing returns, `"missing"`). `tests/test_datasets.py` holds the loading code the tutorial notebooks had at commit f9db4af and requires equal arrays. Only runtime dependencies. - **`timecorr/video.py`**: `render_video(draw, n_frames, path, fps=30, crf=23, hold=0, n_jobs=None, chunk_size=25, retries=0)` (`draw(frames, paths)` is called once per run of at most `chunk_size` consecutive frames in joblib worker processes, 3 or the usable cores by default; PNG frames in a temporary folder; `hold` appends copies of the last frame; with `retries`, workers are stopped after an error and new ones draw the frames whose files do not exist, again in runs of consecutive frames; the video is encoded under a temporary name next to the target and replaces it only on success; encoded with imageio-ffmpeg's ffmpeg, `-c:v libx264 -preset slow -crf -pix_fmt yuv420p -movflags +faststart`, byte for byte what the notebooks' own command gave: `tests/test_video.py`), `show_video(path, width=960)` (an HTML `