Department of Statistics, Yale University
Total Page:16
File Type:pdf, Size:1020Kb
Department of Statistics, Yale University STAT242b Theory of Statistics
Suggested Solutions to Homework 6
Compiled by Marco Pistagnesi
Problem 11.2 a) Omitted. But just a suggestion: do not report actual numbers! Who cares of 100, 500, 1000 random numbers? Who is ever able to interpret them? Be sensible, report relevant information, use the function summary(). b) The prior distribution is f (m)=1. Then we consider the joint density function:
2 ж 1 - (xi - m) 2 ц n ж 1 2 ц f (X , m)= f (X | m) f (m)= зХ e чЧ1 = expз - е (xi - m) ч и 2p ш 2p и 2 ш Thus we find the posterior density (up to a constant): 2 2 ж ц 2 ж ц (xi - m) ж m - 2m X ц (m - X ) f (m | X ) ө f( X,m) ө expз- е ч ө exp - ө expз- ч 2 з ч з ч и 2(1 n) ш з 2(1 n) ч и ш и ш (1).
We recognize the form of (2) as a distribution and thus by Bayesian inference we say that m| X ~ Normal X , 1 the posterior density has the distribution ( n). Remark: Note from this example how Bayesian inference works, and make sure you understand the point. When we divide the joint (likelihood) by the marginal of the x’s, we actually end up just rearranging the joint, as the marginal is independent of the unknown parameter and so will not affect crucially its posterior distribution. So the whole point is to rearrange cleverly the joint, in a way such that by playing around with the constant term, we can re-express it as a density function for the parameter. Hence, notice how in (1) one starts from a joint density of the variable, and ends up with a density for the parameter. You need to be looking for a clever way to perform this switch. Hence the lesson is: with Bayes inference, do not perform blind calculation without thinking (especially of what the constant term will be), this will take you to horrible insensible expression. Always look through your formula and figure out the suitable constant that will lead you to a (on a test, typically familiar) distributional form for the posterior. c) Easy, omitted. d) Because we know that is distributed as a Normal distribution, we may immediately say that is distributed as a log-Normal distribution, with the same parameters as the Normal—that is to say that q ~ log Normal(X ,1 n). Thus the posterior density for is given: n 2 q | X ~ log Norm al( X,1 n) ~ expж- log (q) - x (2 n)ц. е ( i ) q 2p и ш e) We consider a mean-centered posterior interval [–a, a] on a standard normal: P {- a Ј Z Ј a}= P {Z Ј a}- P {- a Ј Z}= P {Z Ј a}- (1- P {Z Ј a})= 2F (a)- 1 Thus we take the 95 percent posterior interval by calculating a: 0.95 = 2F (a)- 1 Ю 0.975 = F (a) Ю a =1.96 Now we consider “un-normalizing” the standard normal to match our distribution: м m - mˆ ь P {-1.96 Ј Z Ј 1.96} = P -1.96 Ј Ј 1.96 = 0.95 н 0.01 э о ю hence, by solving for and plugging your sample mean for the estimate form your simulation, we get the interval. f) We can use the result from e) to state:
1.96 1.96 м mˆ- mˆ+ ь м m - mˆ ь м 1.96 1.96 ь п n m n п 0.95= Pн-1.96 Ј Ј 1.96э = Pнmˆ- Ј m Ј mˆ+ э = Pнe Ј e Ј e э = 0.95 0.01 n n о ю о ю оп юп . 1.96 1.96 й mˆ - mˆ+ щ So that the sought CI is just кe n ,e n ъ. лк ыъ Remark: this easy question puzzled the majority of you (and me too at the beginning). Your struggle was to figure out the moments of the new variable em , which is lognormal. So some of you just computed mean and s.e. for the lognormal and used them as values for the CI. This is wrong, as the probability of the resulting interval is still computed by you referring to the standard normal values. Such your interval would not have probability 0.95. Not that it is a wrong interval, it is sensibly computed, it just is not at 95% significance level, as you are required to do. Some others, used delta method to figure out the above moments. This instead will produce an approximate CI, since the delta method is an asymptotic one. This would again not be consistent with what you are required to do.
Problem 11.3 We begin by determining that the Uniform has density x/ when 0 1 -1 2 For the Poisson, we know: I (l) = Ю I (l) ө f(l) ө l . (Note that the Jeffrey l prior is improper). Hence we have: - nl xi -1 2 -nl xi -1 2 ж 1ц f ( X ,l) = f( X | l) f(l) ө e lе Ч(l ) = e lе ө G x + 1 2, , ( ) зе i nч и ш Which is our posterior. And we notice how it is a special case of the one found in part a), 1 with a = ,b = Ҙ . 2 For those who got this wrong, especially by appealing to some sort of asymptotic arguments, please refer to remark in 11.2/b.