In: Statistics and Probability
Consider a variable X known to have a Poisson distribution. We will consider a null hypothesis that λ = 3.1 (this question will consider one-sided tests only). Suppose we observe X = 7.
(a) State the precise definition of p-value for our observation of 7 events
(b) Calculate the p-value for this observation and interpret
(c) For the observation of 7 events, plot a likelihood function for λ, choosing a sensible range.
(d) Again for the observation of 7 events, plot a log-likelihood function for λ, and estimate a credible interval for λ. A rough estimate is fine. (
e) (harder) A Bayesian comes along and announces that his prior for λ is an exponential distribution with rate 0.6 (that is, P(λ) ∝ e −0.6λ ). Plot his posterior likelihood function for λ, given the observation of 7. hint: you can calculate the density of the exponential distribution using dexp(x,rate=0.6).
Solve this question in R,