Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 12 Bayesian Statistics - inconsistency of sigma #22

Open
BruciiZ opened this issue Nov 24, 2024 · 0 comments
Open

Chapter 12 Bayesian Statistics - inconsistency of sigma #22

BruciiZ opened this issue Nov 24, 2024 · 0 comments

Comments

@BruciiZ
Copy link

BruciiZ commented Nov 24, 2024

The book has:

standard error :

$$ \mbox{SE}(\mu \mid \bar{X})^2 = \frac{1}{1/\sigma^2+1/\tau^2}. $$

To compute a posterior distribution and construct a credible interval, we define a prior distribution with mean 0% and standard error 3.5%, which can be interpreted as follows: before seeing polling data, we don't think any candidate has the advantage, and a difference of up to 7% either way is possible. We compute the posterior distribution using the equations above:

theta <- 0
tau <- 0.035
sigma <- results$se
x_bar <- results$avg
B <- sigma^2 / (sigma^2 + tau^2)

posterior_mean <- B*theta + (1 - B)*x_bar
posterior_se <- sqrt(1/(1/sigma^2 + 1/tau^2))

posterior_mean
posterior_se

From this line of code: B <- sigma^2 / (sigma^2 + tau^2), we know that sigma is defined as $\sqrt{\sigma^2 / n}$, then isn't it wrong to use sigma for posterior_se <- sqrt(1/(1/sigma^2 + 1/tau^2))?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant