numpy.matlib.randn(标准正态分布)
#网址 http://docs.scipy.org/doc/numpy/reference/generated/numpy.matlib.randn.html#numpy.matlib.randn
numpy.matlib.randn
- numpy.matlib.randn(*args)[source]
-
Return a random matrix with data from the “standard normal” distribution.
randn generates a matrix filled with random floats sampled from a univariate “normal” (Gaussian) distribution of mean 0 and variance 1.
Parameters: *args : Arguments
Shape of the output. If given as N integers, each integer specifies the size of one dimension. If given as a tuple, this tuple gives the complete shape.
Returns: Z : matrix of floats
A matrix of floating-point samples drawn from the standard normal distribution.
See also
rand, random.randn
Notes
For random samples from
, use:sigma * np.matlib.randn(...) + mu
Examples
>>>>>> import numpy.matlib
>>> np.matlib.randn(1)
matrix([[-0.09542833]]) #random
>>> np.matlib.randn(1, 2, 3) #和np.matlib.randn( 2, 3)产生相同的效果,不知道为什么要加1,另外不能产生维度更高的,比如np.matlib.randn( 2, 3,4)系统会报错
matrix([[ 0.16198284, 0.0194571 , 0.18312985],
[-0.7509172 , 1.61055 , 0.45298599]]) #randomTwo-by-four matrix of samples from
: #这点非常重要,知道如何产生其它方差和均值的分布; 2.5*2.5=6.25>>>>>> 2.5 * np.matlib.randn((2, 4)) + 3
matrix([[ 4.74085004, 8.89381862, 4.09042411, 4.83721922],
[ 7.52373709, 5.07933944, -2.64043543, 0.45610557]]) #random
numpy.matlib.randn(标准正态分布)的更多相关文章
- numpy.random.randn()与numpy.random.rand()的区别(转)
numpy中有一些常用的用来产生随机数的函数,randn()和rand()就属于这其中. numpy.random.randn(d0, d1, …, dn)是从标准正态分布中返回一个或多个样本值. n ...
- numpy.random.randn()与rand()的区别【转】
本文转载自:https://blog.csdn.net/u010758410/article/details/71799142 numpy中有一些常用的用来产生随机数的函数,randn()和rand( ...
- 【转】numpy.random.randn()与rand()的区别
转自: https://blog.csdn.net/u010758410/article/details/71799142 numpy中有一些常用的用来产生随机数的函数,randn()和rand()就 ...
- numpy.random.randn()和numpy.random.rand()
1 numpy.random.rand() (1)numpy.random.rand(d0,d1,…,dn) rand函数根据给定维度生成[0,1)之间的数据,包含0,不包含1 dn表格每个维度 返回 ...
- [转]numpy.random.randn()用法
在python数据分析的学习和应用过程中,经常需要用到numpy的随机函数,由于随机函数random的功能比较多,经常会混淆或记不住,下面我们一起来汇总学习下. import numpy as np ...
- numpy.random.randn()与numpy.random.rand()的区别
numpy中有一些常用的用来产生随机数的函数,randn()和rand()就属于这其中. numpy.random.randn(d0, d1, …, dn)是从标准正态分布中返回一个或多个样本值. n ...
- C语言产生标准正态分布或高斯分布随机数
C语言 产生标准正态分布或高斯分布 随机数 产生正态分布或高斯分布的三种方法: 1. 运用中心极限定理(大数定理) #include #include #define NSUM 25 double g ...
- 标准正态分布表(scipy.stats)
0. 标准正态分布表与常用值 Z-score 是非标准正态分布标准化后的 x即 z=x−μσ" role="presentation">z=x−μσz=x−μσ 表 ...
- T 分布(近似标准正态分布)
1.1 定义 定义:假设X服从标准正态分布N(0,1),Y服从卡方分布,那么的分布称为自由度为n的t分布,记为. T分布密度函数其中,Gam(x)为伽马函数. 可用于两组独立计量资料的假设检 ...
随机推荐
- linux 如何查找命令的路径
linux 下,我们常使用 cd ,grep,vi 等命令,有时候我们要查到这些命令所在的位置,如何做呢? linux下有2个命令可完成该功能:which ,whereis which 用来查看当 前 ...
- HDU - 1800 Flying to the Mars 【贪心】
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1800 题意 给出N个人的 level 然后 高的level 的 人 是可以携带 比他低level 的人 ...
- Python OOP(2)-static method,class method and instance method
静态方法(Static Method): 一种简单函数,符合以下要求: 1.嵌套在类中. 2.没有self参数. 特点: 1.类调用.实例调用,静态方法都不会接受自动的self参数. 2.会记录所有实 ...
- sublime text的pylinter插件设置pylint_rc后提示错误
sublime text插件pylinter提示错误 Warning: option include-ids is deprecated and ignored. 错误本身是Python的错误,这说明 ...
- Linux查看硬盘使用情况
df df - report file system disk space usage df是查看文件系统磁盘使用情况的命令.如: # df -h Filesystem Size Used Avail ...
- MySQL创建用户并授权及撤销用户权限
这篇文章主要介绍了MySQL创建用户并授权及撤销用户权限.设置与更改用户密码.删除用户等等,需要的朋友可以参考下 MySQL中创建用户与授权的实现方法. 运行环境:widnows xp profess ...
- Delphi 的进制转换
1.10进制转16进制 intTohex(10,4); //第一个参数为要转换的数据,第二个参数为要转换后的16进制位数:得到:000A; 2. 16进制转10进制 strToInt('$'+'64 ...
- 让IE6支持max_height、max_width等等
推荐使用min-height:500px;_height:500px;来解决IE6不能max和min属性的问题.
- Qt 怎么画一个圆角矩形对话框,或者圆角控件
1. 2. 在自定义控件的 构造函数中加入如下一段断码 this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint); //隐藏对话框标题 ...
- codevs1279 Guard 的无聊
题目描述 Description 在那楼梯那边数实里面,有一只 guard,他活泼又聪明,他卖萌又霸气.他每天刷题虐 场 D 人考上了 PKU,如果无聊就去数一数质数~~ 有一天 guard 在纸上写 ...