tensorflow / tensorflow/probability

Posterior predictive distribution in eight schools model does not actually compute the distribution

Open
#447 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

In the Jupyter example Eight_schools.ipynb under the 'Criticism' section we want to compute the posterior predictive distribution. But instead of putting in the entire distribution of theta values into the probability calculation (as the integral would suggest), we just put in the mean theta value. The wikipedia article on this claims that this would underestimate the width of the distribution of the predicted values. I also find that the distribution is more narrow than the distribution of the theta values, which is to be expected.
https://en.wikipedia.org/wiki/Posterior_predictive_distribution
I would like to put in the whole distribution (so e.g. all values of avg_effect_ instead of np.mean(avg_effect_, 0) ), but I couldn't get it to work. I think at the moment what the programme is doing is wrong, especially when compared to what the integral gives for p(y*|y).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open Eight_schools.ipynb and inspect the 'Criticism' section's posterior predictive calculation, especially the use of np.mean(avg_effect_, 0). Compare that calculation with the full avg_effect_ values and the referenced posterior predictive definition; done means the example computes the distribution rather than only the mean and reflects the expected distribution width.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, numpy
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.