Why does the bambi model.graph() plot show the _sigma variable of my Normal likelihood, but not the _mean variable?

Dear Bayesians,

when I define the following Bambi model:

model = bmb.Model(
    "order_amount ~ 0 + age_group + numerical_predictor",
    family="gaussian",
    data=df_data
)

And call the model.graph() funktion, I get the following plot:

The variables shown here are exactly the data variables that I find in the prior group of the InferenceData object. However, in the posterior group of the InferenceData object, I also find the data variable order_amount_mean.

I asked myself, why this “implicit” random variable is not plotted in the model.graph() plot. I would have expected it, because it is obviously an important part of my model.

Best regards
Matthias

1 Like

CC @tcapretto

Which version of Bambi are you using? If you install Bambi 0.14.0 or the version from main, the graph should be updated with more information. What you see there is the mean of the normal.

1 Like

I was using Bambi 0.13.0.

Just noticed that the order_amount_mean data variable only is added by

model.predict(results, kind="pps")

I wasn’t aware of this earlier und wouldn’t have expected that the predictive sampling adds data to the posterior group.

Indeed, after updating to bambi 0.14.0, the model.graph() output low looks like this:

Thanks!

1 Like