#网址 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]]) #random

Two-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

Previous topic

numpy.matlib.rand

Next topic

Miscellaneous routines

numpy.matlib.randn(标准正态分布)的更多相关文章

  1. numpy.random.randn()与numpy.random.rand()的区别(转)

    numpy中有一些常用的用来产生随机数的函数,randn()和rand()就属于这其中. numpy.random.randn(d0, d1, …, dn)是从标准正态分布中返回一个或多个样本值. n ...

  2. numpy.random.randn()与rand()的区别【转】

    本文转载自:https://blog.csdn.net/u010758410/article/details/71799142 numpy中有一些常用的用来产生随机数的函数,randn()和rand( ...

  3. 【转】numpy.random.randn()与rand()的区别

    转自: https://blog.csdn.net/u010758410/article/details/71799142 numpy中有一些常用的用来产生随机数的函数,randn()和rand()就 ...

  4. numpy.random.randn()和numpy.random.rand()

    1 numpy.random.rand() (1)numpy.random.rand(d0,d1,…,dn) rand函数根据给定维度生成[0,1)之间的数据,包含0,不包含1 dn表格每个维度 返回 ...

  5. [转]numpy.random.randn()用法

    在python数据分析的学习和应用过程中,经常需要用到numpy的随机函数,由于随机函数random的功能比较多,经常会混淆或记不住,下面我们一起来汇总学习下. import numpy as np ...

  6. numpy.random.randn()与numpy.random.rand()的区别

    numpy中有一些常用的用来产生随机数的函数,randn()和rand()就属于这其中. numpy.random.randn(d0, d1, …, dn)是从标准正态分布中返回一个或多个样本值. n ...

  7. C语言产生标准正态分布或高斯分布随机数

    C语言 产生标准正态分布或高斯分布 随机数 产生正态分布或高斯分布的三种方法: 1. 运用中心极限定理(大数定理) #include #include #define NSUM 25 double g ...

  8. 标准正态分布表(scipy.stats)

    0. 标准正态分布表与常用值 Z-score 是非标准正态分布标准化后的 x即 z=x−μσ" role="presentation">z=x−μσz=x−μσ 表 ...

  9. T 分布(近似标准正态分布)

    1.1      定义 定义:假设X服从标准正态分布N(0,1),Y服从卡方分布,那么的分布称为自由度为n的t分布,记为. T分布密度函数其中,Gam(x)为伽马函数. 可用于两组独立计量资料的假设检 ...

随机推荐

  1. PHPUnit学习记录

    今天是2017-1-17号,昨晚收到邮件,被view code之后,基本全部需要重构,其实我写得php代码里面完全是东拼西凑的代码,自己都不知道什么意思,今天被要求学习PHPUnit了 ------- ...

  2. Call method 的使用

    SAP学习日志---Call method 的使用 以及常见错误 转载▼   可以通过以下方法 call method 1. 进入全局类中 找到方法,拖到程序中 2. 使用pattern 中的 AAB ...

  3. C#练习DataReader

    SQL代码: create database ThreeDb go USE ThreeDb; GO CREATE TABLE classify --分类表 ( id ,), name ) not nu ...

  4. cloudera impala编译 安装 配置 启动

    无论是采用GDB调试impala或者尝试修改impala源码,前提都是需要本地环境编译impala,这篇文章详细的分享一下impala编译方法以及编译过程遇到的棘手的问题: 前言: impala官方的 ...

  5. ibdata1文件非常大如何解决,ibdata单独存储

    启用独立表空间innodb_file_per_table(如果这个参数没有开启,mysql会将数据.索引.元数据都存入到ibdata中的) 数据表 表索引 MVCC(多版本并发控制)数据 回滚段 撤销 ...

  6. jquery 实现动态表单设计

    只是实现了前台页面的动态表单的设计,并未实现后台绑定数据到数据库等功能.技术使用到的为jquery和bootstrap.俗话说有图有真相,先说下具体效果如下: 点击添加一个面板容器: 容器添加成功: ...

  7. HTML5坦克大战

    在JavaScript中,不要在变量为定义之前去使用,这样很难察觉并且无法运行. 颜色不对. 当我的坦克移动时,敌人坦克消失. tankGame3.html <!DOCTYPE html> ...

  8. NULL 与空字符串

    空字符串 '' 不占内存空间; NULL占一个字节的空间; 空字符串 的判断用 == <> NULL值用 is null ifnull();

  9. node.js+express+jade系列五:ajax登录

    本文通过jquery实现简单的无刷新登录 1:首先要在router中配置登录请求,因为登录需要传user和pwd考虑到安全需用post请求 {        path:'/',        meth ...

  10. wiredtiger存储引擎介绍——本质就是LSM,当然里面也可以包含btree和列存储

    见:http://www.slideshare.net/profyclub_ru/4-understanding-and-tuning-wired-tiger-the-new-high-perform ...