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:enter image description here

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,enter image description here

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); 
有帮助吗?

解决方案

If the correlation is zero, just generate the results for the two independent normals.

What you've written is the density, not the CDF. For normals, there is no closed-form formula for the CDF. However, the joint CDF P{X1 <= x1 & X2 <= x2} = P{X1 <= x1} * P{X2 <= x2} when they're independent, and Matlab can certainly evaluate the results on the right-hand side.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top