$30
Problem 1. Let X1,X2,··· ,X6 be a sequence of independent, identically distributed Bernoulli random variables with parameter θ, and suppose we observe x1 = x2 = x3 = x4 = x5 = 1 and x6 = 0. Derive the posterior probabilities for Model 0 ( and Model 1 ( , assuming the following prior distributions:
In addition, compute the Bayes factor of Model 0 versus Model 1 in (a)-(c).
[Remark: Use paper and pencil to solve this problem, write down the detailed calculation process.]
Problem 2. Write your OWN code to simulate 100 samples from (a) Exponential distribution: Exp(λ) with λ = 2.8.
(b) Normal distribution using BOTH Box-Muller transformation AND central limit theorem: N(µ,σ2) with (a) (µ,σ2) = (0,1) and (b) (µ,σ2) = (3.5,2).
(c) Log-normal distribution LN(µ,σ2) with (a) (µ,σ2) = (0,1) and (b) (µ,σ2) = (−4,2).
(d) Binomial Distribution: Binomial(n,p) with n = 10, p = 0.24.
In each case, plot the density of sample sets to illustrate (validate) your simulated samples.
For part (b), read the attached slides to learn the two methods.
[Remark: Use a computer to simulate those data; explain your code and results carefully]
Problem 3. Write a computing code and use the rejection sampling method to simulate a set of 150 samples from the following distribution with density
where ϕ(x) is the density function of standard normal distribution N(0,1) and . Draw the density of those 150 samples.
[Remark: Use a computer to simulate those data; explain your code and results carefully]
1