sketch a contour plot for the joint pdf of X and Y where X~ = normal (3,1) independent of Y~ Normal (0,4)
The contour plot of the joint pdf of and is as follows, where and independently:
The following R code was used for the plot:
x = seq(-5,5,0.01)
y = seq(-5,5,0.01)
n = length(x)
z = numeric(n*n)
dim(z) = c(n,n)
for(i in 1:n)
{
for(j in 1:n)
{
z[i,j] = dnorm(x[i],mean = 3, sd = 1)*dnorm(y[j], mean = 0, sd = 2)
}
}
contour(x,y,z, xlim = c(-1,6))
points(x = 3, y = 0, pch = 16)
abline(v = 3)
abline(0,0)
Get Answers For Free
Most questions answered within 1 hours.