Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to calculate a Bayes’ estimate of \(\theta\). (Use the posterior mean.)
So, in this case, we have
\[ \theta \mid X_1, X_1, \ldots, X_n \sim \text{Beta}(a = 20, b = 10) \]
Then we have
\[ \hat{\theta}_B = \frac{a}{a + b} = \frac{20}{20 + 10} = \boxed{\frac{2}{3}} \]
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to calculate a Bayes’ estimate of \(\theta\). (Use the posterior mean.)
In this case, we have
\[ \theta \mid X_1, X_1, \ldots, X_n \sim \text{Beta}(a = 82, b = 28) \]
Then we have
\[ \hat{\theta}_B = \frac{a}{a + b} = \frac{82}{82 + 28} = \boxed{\frac{41}{55}} \]
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to calculate a Bayes’ estimate of \(\theta\). (Use the posterior mean.)
In this case, we have
\[ \theta \mid X_1, X_1, \ldots, X_n \sim \text{Beta}(a = 12, b = 63) \]
Then we have
\[ \hat{\theta}_B = \frac{a}{a + b} = \frac{12}{12 + 63} = \boxed{\frac{4}{25}} \]
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to calculate a 99% credible interval
qbeta(c(0.005, 0.995), shape1 = 10 + 2, shape2 = 60 + 3)
## [1] 0.06973818 0.28374039
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to calculate a 90% credible interval
qbeta(c(0.05, 0.95), shape1 = 4 + 2, shape2 = 4 + 3)
## [1] 0.2452998 0.6847622
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to calculate a 95% credible interval
qbeta(c(0.025, 0.975), shape1 = 10 + 2, shape2 = 4 + 48)
## [1] 0.1024842 0.2909709
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to test \(H_0: \theta > 0.50\) vs \(H_1: \theta \leq 0.50\)
pbeta(0.50, shape1 = 10 + 20, shape2 = 4 + 30, lower.tail = FALSE)
## [1] 0.3073275
pbeta(0.50, shape1 = 10 + 20, shape2 = 4 + 30)
## [1] 0.6926725
Accept \(H_1\).
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to test \(H_0: 0.25 < \theta < 0.50\) vs \(H_1: \theta \leq 0.25, \theta \geq 0.50\)
diff(pbeta(c(0.25, 0.50), shape1 = 10 + 5, shape2 = 10 + 15))
## [1] 0.9020704
Accept \(H_0\).
Consider the following model,
and observed data with statistics,
Use the given prior and the observed data to test \(H_0: \theta > 0.80\) vs \(H_1: \theta \leq 0.80\)
pbeta(0.80, shape1 = 3 + 70, shape2 = 3 + 30, lower.tail = FALSE)
## [1] 0.00374593
pbeta(0.80, shape1 = 3 + 70, shape2 = 3 + 30)
## [1] 0.9962541
Accept \(H_1\).