Changelog¶
All notable changes to this project are documented in this file. The format is based on Keep a Changelog.
0.11.4 - 2026-11-10¶
Fixed¶
Observing a root variable (
{"var": <root>, "label": ...}) stoppedrun()and the CLI withValueError: Output character ... appeared more than once in the output. The kernel from all roots to the observation used for thebayesian_inversioncross-check (Net.contract(..., free_roots=True)) wrote the observed root’s einsum letter twice in the output. A root target of that kernel is now the identity (delta) kernel, so root observations work and are cross-checked like any other observation. Results of non-root observations are unchanged (#137).
0.11.3 - 2026-10-18¶
Fixed¶
effects.pngstratum-ACE panels (given_do/given): labels on negative bars were drawn below the bar, so they overlapped the overall-ACE note in the lower right and the overall-ACE dashed line cut through the digits. A negative label now sits inside the bar, near the end toward 0 (just above 0 when the bar is too short to hold it). The overall ACE is the legend entry of that dashed line, placed above the axes. Value labels keep a white background where the line passes behind them (#33).
0.11.2 - 2026-10-15¶
Fixed¶
Checks reported a max error of
0.0for comparisons that were never made. Inancestralmode the joint/soft evidence cross-check (einsum(条件付け)との最大差) and the full-joint check (einsum(全同時)との最大差) were skipped but kept their initial0.0. A max-error entry is nownullunless the comparison was actually made (also without observations), observations whose conditioning check was skipped are listed under条件付けの検算を省略した観測(conditioning_check_skipped), and Markdown states which checks were not run. Posteriors and all values injointmode are unchanged (#26).
0.11.1 - 2026-10-15¶
Fixed¶
Two
effectsitems with the same (treatment, outcome, outcome_label) were stored under the same keyX → Y=y, so the first one (with itsgiven_do/givenresults) was silently overwritten and--checkpassed. The key now includes the stratification when there is one (X → Y=y | do(Z),X → Y=y | W,X → Y=y | do(Z), W); effects withoutgiven_do/givenkeepX → Y=y. Keys that still collide are a config error in--check, andrun()raisesConfigErrorinstead of overwriting (#24).
Added¶
effects[].name: optional result key for an effect (also stored as名前/name).effects.pngshows the key in the panel title when it differs fromX → Y=y, so panels of the same effect can be told apart (#24).
Changed¶
Result keys of effects that use
given_do/given(introduced in 0.11.0) gain the| …suffix described above.
0.11.0 - 2026-10-12¶
Added¶
effects[].given_do: stratified ACE. For each stratum z of one or more other variables (also fixed by intervention), P(outcome | do(X=x), do(Z=z)) for every level and ACE(z), plus the difference between the last and the first stratum (effect modification). Stored under層別ACE(given_do)(stratified_ace_given_do) (#22).effects[].given: conditional ACE. X is fixed by intervention and Z is observed in the intervened model, P(outcome | do(X=x), Z=z); a stratum with probability 0 under do(X=x) isnullwith a warning. Stored under条件付きACE(given)(conditional_ace_given) and cross-checked against the graph-surgery network (#22).Values of
given_do/givenmay be a list of labels, one label ornull(all labels); several variables give the combinations of their labels.--checkreports unknown variables or labels, the treatment or outcome used as a given variable and a variable listed in both keys. Markdown gets a table per stratification andeffects.pnga panel of stratum ACEs. Effects without these keys give exactly the same output as before (#22).
Fixed¶
effects.pngdrew the observed bar of a treatment level with probability 0 as a bar of height 0 labelled “0”, although P(outcome | X=x) is undefined there (nullinresults.json). No bar is drawn now; the level is marked “undefined (P=0)” with a note in the panel.run()issues aUserWarningand the effect lists such levels in観測確率0の水準(zero_probability_levels); Markdown adds a note next to the—(#21).
0.10.1 - 2026-10-12¶
Fixed¶
Soft evidence: the value reported for an observation that contains soft (likelihood) evidence is the expected likelihood Σ P(x) L(x), which can exceed 1, but it was stored as
観測前の確率(evidence_probability) and shown as a percentage (e.g.620.0%for weights[2, 9]on a 0.4 / 0.6 prior). Such entries now use the key尤度の期待値(expected_likelihood), and Markdown andupdates.pngshow it as “expected likelihood 6.2” instead of a probability. Hard-evidence entries and all posteriors are unchanged (#17).An observation with probability 0 under the model raised
ValueErrorand aborted the whole run (a Traceback and exit code 1 from the CLI). The run now continues: aUserWarningis issued, that update is skipped and recorded with不可能な観測: true(impossible), probability 0 and an empty posterior, and the Markdown output says that the observation has probability 0 (updates.pngleaves it out, as there is nothing to compare).Engine.condition_rawandEngine.posterior_rawstill raiseValueErrorwhen called directly (#18).updates.png: a long observation name squashed every panel into thin bars, because the row heading counted as part of the first panel when the layout was computed. The heading is now left out of the layout, wrapped to the figure width and placed above the panel titles, so the panels keep their width (#19).
0.10.0 - 2026-10-11¶
Added¶
interventions: do() on any variable, root or non-root, by graph surgery. A label gives a hard intervention and a probability list a stochastic one. Results (介入) are cross-checked against a direct truncated-factorisation einsum (介入:切断因子分解との最大差) (#3).effects: for each{treatment, outcome}, P(outcome | do(X=x)) and P(outcome | X=x) for every level, plus the ACE, the observational difference and the gap between them (confounding) (因果効果) (#3).observations[].evidence: several observations conditioned on jointly, and soft (likelihood / virtual) evidence{"likelihood": [...]}, computed by variable elimination. Optionalnamefor the result key. Thevar/labelform still works and gives identical results (#4).sensitivity: one-at-a-time sensitivity of P(target=label) to every prior and CPT entry in the target’s ancestor set (±delta with proportional co-variation), sorted by swing (感度分析) (#5).--plotalso writeseffects.png(observed vs intervened) andsensitivity.png(tornado chart) when the corresponding keys are set (#7). Markdown output has sections for interventions, effects and sensitivity.--json-keys ja|enandto_english_keys(res)writeresults.json/ stdout JSON with English keys. The default stays Japanese, and snapshots always keep the Japanese keys so--diffworks across versions. Names chosen by the user are never translated (#6).Python API:
Engine.posterior_raw(evidence),Net.contract(...)(variable elimination with evidence, do() and CPT overrides),do_config(cfg, do),fxtensor_bayesnet.causal.sensitivity.--diffreports changes tointerventions,effectsandsensitivity, and changes in intervention marginals and ACEs.Example
examples/ecology_host_parasitoid/(English): observation vs intervention in a host–parasite–parasitoid cascade, with a script that checks the ACEs against an independent truncated factorisation. All numbers are illustrative placeholders (#8).
Fixed¶
The built-in cross-check
einsum(全同時)との最大差failed (AssertionError) when a root variable was declared invariablesafter a non-root variable. The declaration order no longer matters (#1).MemoryError: 配線核が大きすぎますwhen observations were applied with a joint of roughly 560k–2M elements (e.g. 13 three-state variables). In joint mode, marginals and pairs now fall back to summing the joint directly when the dense wiring kernel would exceedMAX_WIRING(lowered from 5M to 1M elements). The 13-variable chain now peaks at about 50 MB. Thebayesian_inversioncross-check is skipped (and listed in the checks) when the roots × observation tensor would be too large (#2).
Changed¶
scenarioson a non-root variable now suggestsinterventionsin the validation error.
0.9.1 - 2026-10-10¶
Fixed¶
--diff <folder>crashed withIsADirectoryError. A snapshot folder is now accepted (itsconfig.jsonandresults.jsonare used); a missing path or a folder withoutconfig.jsongives a clear error and exit code 2.--snapshotchecked for an existing snapshot only after writing results and figures. The check now happens first; without--forcenothing is written and the exit code is 1.--diffdid not report changes to thereasonof root priors, and omitted the rows of kernels whose parents changed. It now reports prior reasons, the parent change with all old and new rows, and added/removed rows.The
einsum(条件付け)との最大差andbayesian_inversionとconditionalizationの最大差checks compared values rounded to 4 decimals. They now compare unrounded values (and the tolerance is tightened accordingly).-0.0could appear in diffs and Markdown output; values are now normalized to0.0.
Documentation¶
READMEs (English and Japanese) state that a snapshot with the same date as
as_ofis never picked automatically by--diff, and document folder paths for--diffand the new--snapshotbehaviour.
0.9.0 - 2026-10-10¶
First public release.
Added¶
Config-driven discrete Bayesian network inference built on fxtensor-salmon (
FXTensor): marginals per scenario, Bayesian updating on observations, and root-cause inference viabayesian_inversion.Automatic cross-check of every result against a direct numpy
einsumcomputation; ancestor-set computation for large joint distributions.Config validation (
--check) reporting all errors at once (row sums, missing/extra rows, undefined parents, cycles, …).Daily snapshots (
--snapshot,--force) and diffs against the previous snapshot (--diff).Output as JSON, Markdown (
--md) and a colour-coded mermaid diagram (model.mmd);--no-write,--out-dir,--history-dir,--format-config.Figures with matplotlib (optional extra
[plot]): network structure with a layered layout, marginals by scenario, prior vs posterior for observations, and day-over-day changes (--plot,--plot-format png|svg,--plot-dpi). Japanese fonts are detected automatically.--lang ja|enfor Markdown and figure text.Examples: weather and equipment maintenance, each in Japanese and English.
README in English and Japanese.