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
,我可以这样做integrate.nquad
:
x, y=5, 4
F_at_x_y = integrate.nquad(f, [[-inf, x],[-inf, y]])
现在,我需要整个F(x,y)
in the x-y
面板,看起来像这样:
我怎样才能做到这一点?
主要问题是,对于从(-30,-30)
to (30,30)
,我需要做一个integrate.nquad
从头开始得到F(x,y)
。这太慢了。
我想知道,因为结果是连续的(例如,你得到F(5,6)
通过价值F(4,4)
,并从这两点之间的区域进行积分),是否可以加快该过程?所以我们不需要做integrate
从头开始在每个点上,从而使过程更快。
可能有用的链接:
使用 scipy 在 Python 中实现多元正态 CDF https://stackoverflow.com/questions/30560176/multivariate-normal-cdf-in-scipy
http://cn.mathworks.com/help/stats/mvncdf.html http://cn.mathworks.com/help/stats/mvncdf.html
我正在考虑借一些东西斐波那契数列
如何用Python编写斐波那契数列 https://stackoverflow.com/questions/494594/how-to-write-the-fibonacci-sequence-in-python