讲解:STAT40410、UCD Monte Carlo、R、RC/C++|Java

UCD Monte Carlo inference - STAT404102019-2020 Nial FrielAssignment 4Hand-in date: Monday 25th of November, 12pm1) You are hired as a statistician to investigate absenteism in a company. You believe that absensesfollow a Poisson(λ) distribution and, before seeing any evidence, you are 75% sure that the valueof λ is less than 5 and decide to use an exponential distribution as your prior for λ. You take arandom sample of 50 students and find out the number of absences that each has had over thepast semester. You discover that HR has only recorded the precise number of absences for anyemployee if they have had 2 or more absences in the past 12 months. Therefore the data donot discriminate between those who have had 0 absences and those who have had 1 absence.The data that you are provided with are summarised below.Number of absences ≤ 1 2 3 4 5 6 7 8 9 10Frequency 18 13 8 3 4 3 0 0 0 1(a) Derive carefully an algorithm to estimate the posterior distribution of λ. [10](b) Similarly, explain STAT40410代做、代写UCD Monte Carlo、how one might explore the posterior distribution of z, the number ofemployees out of the sample of 50 who had no absences during the previous 12 months.[10](c) Write R code to implement this algorithm. [20](d) Provide suitable summaries (posterior means and variances, credible intervals, probabilitydensities etc.) to communicate your conclusions regarding λ and z. [20]2) Consider again, the example which we have examined recently in lectures. Namely, to estimatethe probability P(X > 2) where X follows a Cauchy distribution with densityf(x) = 1π(1 + x2), x ∈ R.(a) Implement an algorithm in R to estimate this probability using control variates. (You canuse the same approach developed in the lectures). [20](b) Similarly, implement an algorithm in R to estimate this probability using importance sampling(without employing control variates). (Again, using the same approach in lectures).[10](c) Compare the estimated variance resulting from the estimators in 1. and 2. above. [10]转自:http://www.daixie0.com/contents/18/4341.html

你可能感兴趣的:(讲解:STAT40410、UCD Monte Carlo、R、RC/C++|Java)