What's the correct syntax for displaying confidence intervals around the mean?

Thanks. Understood they are not frequentist intervals. My bad for using the wrong terminology.

Figured out the syntax:

fig = plt.figure(figsize=(15,4))
a=sns.lineplot(x =df_sat_test['t'], y = np.array(test_ppc.posterior_predictive.obs.mean(dim=['chain', 'draw'])), label = 'Posterior Prediction', color = 'red')
b=sns.lineplot(x =df_sat_test['t'], y = np.array(test_ppc.posterior_predictive.obs.quantile(q=.025, dim=['chain', 'draw'])), label = 'Confidence',
               color = 'skyblue', alpha=.3)
c=sns.lineplot(x =df_sat_test['t'], y = np.array(test_ppc.posterior_predictive.obs.quantile(q=.975, dim=['chain', 'draw'])), label = 'Confidence',
               color = 'skyblue', alpha=.3)
line = c.get_lines()
plt.fill_between(line[0].get_xdata(), line[1].get_ydata(), line[2].get_ydata(), color='skyblue', alpha=.3)

sns.scatterplot(x =df_sat_test['t'], y = np.array(test_ppc.observed_data.obs), label = 'True Value', color='black')
plt.legend()
1 Like