python 随机产生多维高斯分布点
来源:互联网 发布:淘宝购买叶罗丽娃娃 编辑:程序博客网 时间:2024/05/01 07:18
http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.multivariate_normal.html(请参考这个网址)
numpy.random.multivariate_normal
Draw random samples from a multivariate normal distribution.
The multivariate normal, multinormal or Gaussian distribution is a generalization of the one-dimensional normal distribution to higher dimensions. Such a distribution is specified by its mean and covariance matrix. These parameters are analogous to the mean (average or “center”) and variance (standard deviation, or “width,” squared) of the one-dimensional normal distribution.
mean : 1-D array_like, of length N
Mean of the N-dimensional distribution.
cov : 2-D array_like, of shape (N, N)
Covariance matrix of the distribution. It must be symmetric and positive-semidefinite for proper sampling.
size : int or tuple of ints, optional
Given a shape of, for example, (m,n,k), m*n*k samples are generated, and packed in an m-by-n-by-k arrangement. Because each sample is N-dimensional, the output shape is (m,n,k,N). If no shape is specified, a single (N-D) sample is returned.
out : ndarray
The drawn samples, of shape size, if that was provided. If not, the shape is (N,).
In other words, each entry out[i,j,...,:] is an N-dimensional value drawn from the distribution.
Notes
The mean is a coordinate in N-dimensional space, which represents the location where samples are most likely to be generated. This is analogous to the peak of the bell curve for the one-dimensional or univariate normal distribution.
Covariance indicates the level to which two variables vary together. From the multivariate normal distribution, we draw N-dimensional samples, . The covariance matrix element is the covariance of and . The element is the variance of (i.e. its “spread”).
Instead of specifying the full covariance matrix, popular approximations include:
- Spherical covariance (cov is a multiple of the identity matrix)
- Diagonal covariance (cov has non-negative elements, and only on the diagonal)
This geometrical property can be seen in two dimensions by plotting generated data-points:
Diagonal covariance means that points are oriented along x or y-axis:
Note that the covariance matrix must be positive semidefinite (a.k.a. nonnegative-definite). Otherwise, the behavior of this method is undefined and backwards compatibility is not guaranteed.
References
Examples
The following is probably true, given that 0.6 is roughly twice the standard deviation:
- python 随机产生多维高斯分布点
- 多维高斯分布模型
- 产生高斯分布随机数
- python opencv(2) 随机产生像素点
- 产生高斯分布的随机变量
- C++高斯分布随机数的产生
- 怎样产生标准分布或高斯分布的随机数?
- 怎样产生标准分布或高斯分布的随机数
- 怎样产生标准分布或高斯分布的随机数?
- 机器学习5 多维正态分布(高斯分布)
- Cholesky分解对任意多维高斯分布进行采样
- Python画图高斯分布
- 高维空间中的高斯分布和随机投影
- 多维高斯分布协方差矩阵对数据分布的影响
- python 产生随机字符串
- python产生随机字符串
- python产生随机数组
- Python数据可视化之高斯分布
- uvalive6588
- 简单的listview实现
- TCP之深入浅出send和recv
- PAT 1019. General Palindromic Number (20)
- python正则表达式
- python 随机产生多维高斯分布点
- hdu3646 Fate Stay Night(dp,读题障碍)
- Notification_安卓
- HDU 5533 Dancing Stars on Me(判断n个整数点是否能组成正n边形)——2015ACM/ICPC亚洲区长春站
- Longest Common Prefix
- HDOJ 1995 汉诺塔V
- 粒子群算法的matlab实现
- 【程序44】 题目:一个偶数总能表示为两个素数之和。
- 拼图小游戏“ST--拼图”开发篇之主要功能的实现(三)