Exercise

# Interval estimates

Suppose Rebekah's posterior density for `P`

is a beta curve with shape parameters 24.13 and 7.67.

To find a 90% Bayesian probability interval, you can use the beta quantile function `qbeta()`

where the inputs are the probabilities 0.05 and 0.95.

Then you can use the `beta_interval()`

function to plot the interval with some helpful annotations:

```
qbeta(c(0.05, 0.95), 24.13, 7.67)
beta_interval(0.90, c(24.13, 7.67))
```

Instructions

**100 XP**

Suppose Harry also wants to find a probability interval for `P`

; his beliefs about the proportion `P`

are described by a beta curve with parameters 19 and 7.

- Store the shape parameters of Harry's beta curve in a vector
`ab`

. - Use the function
`qbeta()`

to construct a 90% interval. - Use the
`beta_interval()`

function to visualize this probability interval.