Question: Refer to image. Please write using R code. Problem 3 . Suppose that ( x , Y ) follows a bivariate normal distribution with a

Refer to image. Please write using R code. Problem 3. Suppose that (x,Y) follows a bivariate normal distribution with a joint density
f(x,y)=12121-22exp[-12(1-2){(x-1)212-2(x-1)(y-2)12+(y-2)222}]
where 1=1,2=2,1=1,2=2, and correlation =0.5.
(a) Write R code for a 3D plot of f(x,y) vs.(x,y) over the grid points grid. ,
3, by=0.1) for x and grid. , by =0.1 for y.
(b) To sample (x,Y) from this joint distribution, one can use the following algorithm:
(i). generate x from its marginal distribution N(1,12);
(ii). generate Y given x from a conditional density
Y|x=xN(2+21(x-1),(1-2)22).
Use this algorithm to generate n=10,000 pairs of random values from this joint
distribution.
(c) Based on the 10,000 pairs of random values, calculate the sample correlation coefficient
r between the x- and Y-samples and also evaluate the following probabilities:
(c1).P(x0.5,Y1.3)
(c2).P(x1.5|Y3.0)
 Refer to image. Please write using R code. Problem 3. Suppose

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!