Reproducing an example from PyCon 2017

Ok, I think I got it. For the second question (the first, I am 90% confident it’s ok), would be something like:

with my_model:    
    # To find difference of the posteriors we find the mean of each
    # num_chains*num_samples_per_chain and then subtract them
    mean_1st_weeks = np.mean(pred["first_weeks"], axis=1)
    print(mean_1st_weeks.shape)
    mean_2nd_weeks = np.mean(pred["second_weeks"], axis=1)
    print(mean_2nd_weeks.shape)
    
    # Now:
    diff = mean_1st_weeks - mean_2nd_weeks
    print(diff.shape)
    print(diff)

    az.plot_posterior(diff, ref_val=0)

imagen
With an increase of the 94% HDI width, as one would expect from a posterior sample. Now I think this second question is ok with 90% of confidence, too.