Bambi Beta Regression Inference

Thanks again for your quick replies. So you were right this is already in the model_fitted object available.

pexpit=model2_fitted.posterior_predictive.P_alive.values #values are already in original form. No expit() necessary (?)
mu_hat=np.concatenate((pexpit[0,:,:],pexpit[1,:,:]),axis=0) #both chains
mu_hat_mean=mu_hat.mean(axis=0) #average over all draws
indexfuncfunc=np.multiply(mu_hat_mean,1-mu_hat_mean).mean(axis=0) #average over all observations

#AME = indexfuncfunc * some_beta

As a sidenote. I get quite different results depending on when I average the observations, meaning if I don’t calculate the mu_hat_mean but calculate the indexfuncfunc with mu_hat and then averaging I get 0.071 instead of 0.191 in my case.