scipy.stats.multivariate

您所在的位置:网站首页 多维概率分布函数 scipy.stats.multivariate

scipy.stats.multivariate

2024-07-09 22:02| 来源: 网络整理| 查看: 265

参考地址:https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.multivariate_normal.html

scipy.stats.multivariate_normal

 

Parameters:

x : array_like

Quantiles, with the last axis of x denoting the components.

mean : array_like, optional

Mean of the distribution (default zero)

cov : array_like, optional

Covariance matrix of the distribution (default one)

Alternatively, the object may be called (as a function) to fix the mean

and covariance parameters, returning a “frozen” multivariate normal

random variable:

rv = multivariate_normal(mean=None, scale=1)

Frozen object with the same methods but holding the given mean and covariance fixed.

The probability density function for multivariate_normal is

f(x) = \frac{1}{\sqrt{(2 \pi)^k \det \Sigma}} \exp\left( -\frac{1}{2} (x - \mu)^T \Sigma^{-1} (x - \mu) \right),

where \mu is the mean, \Sigma the covariance matrix, and k is the dimension of the space where x takes values.

 

举例:

from scipy.stats import multivariate_normal import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 5, 10, endpoint=False) x

 

y = multivariate_normal.pdf(x, mean=2.5, cov=0.5); y

 

plt.plot(x, y)



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3