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)为伽马函数. 可用于两组独立计量资料的假设检 ...
随机推荐
- java面向对象入门之方法参数的传递
/* Name : Power by :Stuart Date:2015.4.25 */ class PassOn{ //创建show方法,把i传入,输出i+1的结果 public void show ...
- table control里面各种属性和事件
[转自]http://blog.csdn.net/hackai886/article/details/7935366 SAP中,Table Control是在Screen中用的最广泛的控件之一了,可以 ...
- js基础--substr()和substring()的区别
最近做项目的时候,字符串截取一直用的是substr()方法,有时候需要截取的内容是中间部分的话就很麻烦,需要分两次,第一次截取前半部分,第二次在第一次的基础上截取后半部分.写了几次之后总觉得没对,应该 ...
- sql获取数组长度
需求:获取字符串数组1,2,3,4的长度,当然也可以是其他分隔符1|2|3等 方法:通过自定义函数来实现 /* 获取字符串数组长度 */ from sysobjects where id = obje ...
- CVPR 2018:diractNets网络,有残差网络好吗?
我把我明天讲PPT的材料弄上来了........哈 哈哈
- Yii2 如何实现表单事件之 Ajax 提交
前言 Yii2 现在使用 JS 都必须要注册代码了. 要实现 Ajax 提交,有两种方法.一是直接在 ActiveForm 调用 beforeSubmit 参数,但是个人认为这样没有很好的把 JS 和 ...
- 牛客小白月赛1 A 简单题 【数学】
题目链接 https://www.nowcoder.com/acm/contest/85/A 思路 这个 就是 E 但是 运算的时候 要保证 其精度 AC代码 #include <cstdio& ...
- MySQL 创建索引(Create Index)的方法和语法结构及例子
MySQL 创建索引(Create Index)的方法和语法结构及例子 MySQL 创建索引(Create Index)的方法和语法结构及例子 CREATE INDEX Syntax CREATE ...
- c的详细学习(9)结构体与共用体的学习(一)
C语言提供了另外两种构造类型:结构体与公用体,用来存储若干个类型不同但彼此组成一个集合的数据总体. (1)结构体类型与结构体变量 1.定义 其一般形式为: struct 结构体类型名{ 数据类型1 ...
- HTTPS协议原理透析
1.HTTPS本身并非协议,而是标准的HTTP协议架在SSL/TLS协议之上的一种结构.(一种不太合适的说法可以认为是两种协议的叠加).HTTP是工作在OSI7层模型的最上层,就是第7层:Applic ...