Skip to content

Commit

Permalink
default observed to False if group prior
Browse files Browse the repository at this point in the history
  • Loading branch information
aloctavodia committed Feb 2, 2024
1 parent 44db4c8 commit 07192ac
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions arviz/plots/ppcplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def plot_ppc(
kind="kde",
alpha=None,
mean=True,
observed=True,
observed=None,
observed_rug=False,
color=None,
colors=None,
Expand Down Expand Up @@ -60,8 +60,9 @@ def plot_ppc(
Defaults to 0.2 for ``kind = kde`` and cumulative, for scatter defaults to 0.7.
mean : bool, default True
Whether or not to plot the mean posterior/prior predictive distribution.
observed : bool, default True
Whether or not to plot the observed data.
observed : bool
Whether or not to plot the observed data. Defaults to True for ``group = posterior``
and False for ``group = prior``.
observed_rug : bool, default False
Whether or not to plot a rug plot for the observed data. Only valid if `observed` is
`True` and for kind `kde` or `cumulative`.
Expand Down Expand Up @@ -253,8 +254,12 @@ def plot_ppc(

if group == "posterior":
predictive_dataset = data.posterior_predictive
if observed is None:
observed = True
elif group == "prior":
predictive_dataset = data.prior_predictive
if observed is None:
observed = False

Check warning on line 262 in arviz/plots/ppcplot.py

View check run for this annotation

Codecov / codecov/patch

arviz/plots/ppcplot.py#L261-L262

Added lines #L261 - L262 were not covered by tests

if var_names is None:
var_names = list(observed_data.data_vars)
Expand Down

0 comments on commit 07192ac

Please sign in to comment.