Closed wd60622 closed 1 month ago
Hi @wd60622 do you mean this:
import numpy as np
import pandas as pd
import pymc as pm
import matplotlib.pyplot as plt
from pymc_marketing.mmm.plot import plot_curve
seed = sum(map(ord, "Arbitrary curve"))
rng = np.random.default_rng(seed)
dates = pd.date_range("2024-01-01", periods=52, freq="W")
coords = {"date": dates, "product": ["A", "B"]}
with pm.Model(coords=coords) as model:
data = pm.Normal(
"data",
mu=[-0.5, 0.5],
sigma=1,
dims=("date", "product"),
)
cumsum = pm.Deterministic(
"cumsum",
data.cumsum(axis=0),
dims=("date", "product"),
)
idata = pm.sample_prior_predictive(random_seed=rng)
curve = idata.prior["cumsum"]
fig, axes = plot_curve(
curve,
non_grid_names={"date"},
subplot_kwargs={"figsize": (15, 5)},
)
plt.show()
you want plot_sample
instead of plot_curve
?
In the docstring in the details for the sample_kwargs, the wrong function is referenced.
That example is fine
This is what is incorrect
https://www.pymc-marketing.io/en/latest/api/generated/pymc_marketing.mmm.plot.plot_curve.html#pymc_marketing.mmm.plot.plot_curve
References
plot_curve
instead ofplot_samples