plot_counterfactual#

impulso.plotting.plot_counterfactual(result, prob=0.89, figsize=None)[source]#

Plot actual vs counterfactual paths, one panel per variable.

The actual path is drawn in black; the counterfactual posterior median in colour with its HDI band shaded around it.

Parameters:
  • result (CounterfactualResult) – CounterfactualResult.

  • prob (float) – Probability mass for the HDI band. Default 0.89.

  • figsize (tuple[float, float] | None) – Figure size. Defaults to (12, 3 * n_vars).

Returns:

Matplotlib Figure.

Return type:

Figure