嗨,我正试图判断多元正态分布,以得到$z_{1}in(1,+2.178)$和$z_{2}\in(2.178,\inty)$的概率.分布的平均值为零,所有方差为1,协方差为$1/\SQRT(2)$.
在R
中,我通过以下方式获得正确的结果:
library(mnormt)
sadmvn(lower=c(1, 2.178), upper=c(2.178, Inf), mean=0, varcov=matrix(c(1, 1/sqrt(2), 1/sqrt(2), 1),2, 2))
在西西里,我试图:
from scipy import stats
cov = np.array([[1, 1 / np.sqrt(2)], [1 / np.sqrt(2), 1]])
d = stats.multivariate_normal(mean=np.array([0, 0]), cov=cov)
alpha2 = d.cdf([2.178, np.Inf]) - d.cdf([1, 2.178])
但这给出了大约0.14的结果.我怎样才能正确地做这件事?