STAT8150 7150assignment1
STAT8150 7150assignment1
STAT 8150/7150
Instructions:
2. Due on 24th March 2023. You need to submit your assignment via the iLearn
submission link.
3. Submission of your assessment to the iLearn link implies that you uphold academic
integrity. This is an individual assessment task. You may discuss this assignment
with your fellow students; however, your results and writing up must be your own
work. The iLearn submission link will allow you to submit a maximum of one
PDF file. If you have multiple files, please consolidate them into one file before
submission.
5. A cover page is not required. However, the document must have your name and
student ID on the file.
1 of 3
Bayesian Data Analysis Assignment 1: Due Week 5, 2023
PART 2. A hospital collects the number of patients in the emergency room admitted
between 10 pm and 11 pm for each day of a week. The following table records the day
and the number of ER visits for the given day.
Suppose one assumes Poisson sampling for the counts and a conjugate Gamma prior with
parameters α = 70 and β = 10 for the Poisson rate parameter λ.
(f) (4 marks) Given the sample shown in the Table, obtain the posterior distribution for λ
through the Gamma-Poisson conjugacy. Obtain a 95% posterior credible interval for λ.
(g) (2 marks) Suppose a hospital administrator states that the average number of ER visits
during any evening hour does not exceed 6. By computing a posterior probability, evaluate
the validity of the administrator’s statement.
(h) (2 marks) The hospital is interested in predicting the number of ER visits between 10pm
and 11pm for another week. Use simulations to generate posterior predictions of the
number of ER visits for another week (seven days).
2 of 3
Bayesian Data Analysis Assignment 1: Due Week 5, 2023
Here, the parameter λ > 0, considered as the rate of event occurrences. This is a one-
parameter model.
(a) (4 marks) Use the prior distribution λ ∼ Gamma(a, b), and find its posterior dis-
i.i.d.
tribution π (λ | y1 , · · · , yn ), where yi ∼ Exponential(λ) for i = 1, · · · , n. Do you
recognise a known distribution? Is the Gamma prior a conjugate prior for this model?
(b) (3 marks) Define the Jeffreys prior for the parameter λ. Is it proper or improper
prior? (Justify your claim)
(c) (3 marks) Suppose 10 times between traffic accidents are collected: 1.5, 15, 60.3,
30.5, 2.8, 56.4, 27, 6.4, 110.7, 25.4 (in minutes). With the posterior distribution
derived in part (a), use Monte Carlo approximation to calculate the posterior mean,
median, and middle 95% credible interval for the rate λ.
(d) (2 marks) Use Monte Carlo approximation to generate another set of 10 predicted
times between events.
PART 2. The Weibull distribution is often used as a model for survival times in biomed-
ical, demographic, and engineering analyses. A random variable Y has a Weibull distri-
bution if its pdf is as follows.
Here, α > 0 and λ > 0 are parameters of the distribution. For this problem, assume that
α = α0 is known, but λ is not known, i.e. a simplified case of a one-parameter model.
Also, assume that software routines for simulating from Weibull distributions are available
(e.g., rweibull())
3 of 3