I have a probability density function (pdf) f(x,y)
. And to get its cumulative distribution function (cdf)F(x,y)
at point (x,y), you need to integrate the f(x,y)
, like this:
In Scipy
, I can do it by integrate.nquad
:
x, y=5, 4
F_at_x_y = integrate.nquad(f, [[-inf, x],[-inf, y]])
Now, I need the whole F(x,y)
in the x-y
panel, something look like this:
How can I do that?
The main problem, is that for every point ranging from (-30,-30)
to (30,30)
, I need to do a integrate.nquad
from scratch to get the F(x,y)
. This is too slow.
I'm wondering, since the results are successive (For example, you get F(5,6)
by the value of F(4,4)
, and integrate from the regions between these 2 points), if it is possible to speed up the process? So we don't need to do integrate
from scratch at every point, and hence make the process quicker.
Possible useful links:
Multivariate Normal CDF in Python using scipy
http://cn.mathworks.com/help/stats/mvncdf.html
And I'm thinking about borrowing something from Fibonacci Sequence