November 30th, 2005, 3:30 pm
The code you give is to generate a Monte Carlo sample from the copula, which is a bit different to plotting the density. To plot the density of a bivariate copula with correlation 'rho' on the grid (0.01,0.02,...,.99) * (0.01,0.02,...,.99) use the following code% requires the statistics toolbox for the functions norminv.m and mvnpdf.mp=zeros(99,99);u=0.01:0.01:0.99;for i = 1:99 for j = 1:99 x1 = norminv(u(i)); x2 = norminv(u(j)); p(i,j) = mvnpdf([x1 x2],[0 0],[1 rho; rho 1])/normpdf(x1)/normpdf(x2); endendsurf(u,u,p)figure, contour(u,u,p)