Reference no: EM132407903
Problem 1 - Suppose that X ∼ Beta(2, 2) distribution, whose density function is f(x) = 6x(1 - x) for 0 < x < 1. Use a) a rejection sampling method and b) an importance sampling method to evaluate Var(X). Explain how you do it and write two separate pseudo-codes to implement the two methods.
Problem 2 - (a) Develop a Gibbs sampling method to simulate from a bivariate vector (X1, X2) from a bivariate normal distribution with zero mean and unit variance for the marginals, but a non-zero correlation of rho (r) between the two components. Explain how you do it and write a pseudo-code to implement it. (b) Suppose that you have N copies of the random sample (vector) simulated from your code. Explain how to use them to evaluate E{(X1+X2)2} and also the median of the distribution of (X1+X2)2.
Problem 3 - Let (W1(t), . . . , Wn(t)) be n independent Brownian motions. Define the new process
Bn(t) = √(W12(t) + . . . + Wn2(t)).
This process, called a Bessel process, describes the distance to the origin of an n-dimensional Brownian motion. We can show that Bn satisfies the equation
dBn(t) = dZ(t) + (n-1)/(2Bn(t))dt
where Z(t) is a suitable Brownian motion. Assume that Bn(0) ≠ 0. Explain how to simulate a sample path of such a Bessel process and write a pseudo-code to implement it.
Problem 4 - (a) State the Bayes theorem.
(b) A disease has an overall base rate p(D) = .001. A test for the disease has sensitivity S (i.e, p(test positive |D) = S and specificity Q (i.e., p(test - |no D) = Q). If a patient tests positive what is the Bayesian posterior P(D|test +)?
(c) Numerical examples. Suppose S = Q = .99. What is the posterior P (D |test +)? Suppose S = .99, Q = .90. What is the posterior P(D|test +)?
Note - Need show steps for algorithm and few R code.