Errors with sampling

You overwrote your posterior when you called

posterior_f = pm.sample_posterior_predictive(posterior_f)

You can do

posterior_f = pm.sample_posterior_predictive(posterior_f, extend_inferencedata=True)