Exercise 1: Eliciting an expert prior

In the context of the historical example, we want to elicitate a prior distribution from expert knowledge.

Now, let’s imagine we have 2 expert demographers, each giving their expert opinion about the value they think plausible for θ (the probability of a birth being a girl rather than a boy).

We asks each of them to give values for which the probability of θ being lower would be respectively 10%, 25%, 50%, 75%, and 90%. First expert says: P(θ<0.2)=10%,P(θ<0.4)=25%,P(θ<0.5)=50%,P(θ<0.6)=75%,and P(θ<0.8)=90% while the second expert says: P(θ<0.5)=10%,P(θ<0.6)=25%,P(θ<0.7)=50%,P(θ<0.8)=75%,and P(θ<0.9)=90%

  1. First, let’s load the SHELF R package:

    library(SHELF)
  2. Using the fitdist() function from the SHELF package, estimate the parameter form the Beta distribution that best fit each of those elicitations (Protip: have a look at the package intro vignette here).

  3. Plot those two Beta prior distributions, along with the “linear pooling” of their 2 curves using the plotfit() function from the SHELF package (Protip: use the lp = TRUE argument).

  4. Derive a consensus Beta prior, by averaging each of both expert quantiles, and plot it.