I am trying to find the cdf of a bivariate normal distribution. I am using the mvncdf function to calculate the cdf of a bivariate normal distribution.
Bivariate normal distribution:
When $\rho$ is 0,mvncdf in matlab gives an error.
It says SIGMA must be a square, symmetric, positive definite matrix.
I know when $\rho$ is 0, the distribution reduces to a simpler one, but how do I implement this? Is it using normcdf?
How do I solve this problem?
Based on this image,
I just need to generate two cdfs and multiply it together right?
This is what I am doing now:
term1 = normcdf(-norminv(K1/(1-R)),0,1)*normcdf(C,0,1);
term2 = normcdf(-norminv(K2/(1-R)),0,1)*normcdf(C,0,1);
Code for cov matrix:
a=sqrt(rho);
cov_mat = [1 -sqrt(1-a^2);-sqrt(1-a^2) 1];
term1 = mvncdf([-norminv(K1/(1-R)) C], [0 0], cov_mat);
term2 = mvncdf([-norminv(K2/(1-R)) C], [0 0], cov_mat);