#网址 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

>>>

  1. >>> import numpy.matlib
  2. >>> np.matlib.randn(1)
  3. matrix([[-0.09542833]]) #random
  4. >>> np.matlib.randn(1, 2, 3) #和np.matlib.randn( 2, 3)产生相同的效果,不知道为什么要加1,另外不能产生维度更高的,比如np.matlib.randn( 2, 3,4)系统会报错
  5. matrix([[ 0.16198284, 0.0194571 , 0.18312985],
  6. [-0.7509172 , 1.61055 , 0.45298599]]) #random

Two-by-four matrix of samples from : #这点非常重要,知道如何产生其它方差和均值的分布; 2.5*2.5=6.25

>>>

  1. >>> 2.5 * np.matlib.randn((2, 4)) + 3
  2. matrix([[ 4.74085004, 8.89381862, 4.09042411, 4.83721922],
  3. [ 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. 用swift创建各种UI控件【iSwifting社区】

    为了方便大家学习,www.iSwifting.com社区为大家准备了创建各种UI控件的代码.開始看着语法可能有些别扭,当用习惯了,就认为还是非常不错的. 社区还添加了问答专区.有问题的朋友.虽然问.大 ...

  2. ABAP制作密码输入框

    [转自 http://blog.csdn.net/saphome/article/details/6956911] 这几天做一个系统维护的程序,需要用户输入用户名和密码登录.可怎样实现输入密码显示星号 ...

  3. 目标检测--之RCNN

    目标检测--之RCNN 前言,最近接触到的一个项目要用到目标检测,还有我的科研方向caption,都用到这个,最近电脑在windows下下载数据集,估计要一两天,也不能切换到ubuntu下撸代码~.所 ...

  4. Redis持久化——RDB(一)

    核心知识点: 1.RDB:将当前数据生成快照保存到硬盘 2.手动触发 save:会阻塞Redis服务器直到RDB完成. bgsave:执行fork创建子进程,由子进程负责RDB操作,阻塞只发生在for ...

  5. 2个canvas叠加运用(时钟例子)

    最近在学习canvas,http://corehtml5canvas.com/code-live/,主要的学习方式就是通过上面的一些例子来学习canvas的一些用法.但是我发现,这里的例子,只要can ...

  6. ubuntu13.04中把ibus中的中文拼音输入设为默认

    全新的ubuntu ,先选择 下载服务器 首选项->软件和更新 选择 最佳服务器 准备工作:卸载Ubuntu默认的ibus输入法: sudo apt-get remove ibus 然后添加Fc ...

  7. Data Structure Trie: suffix problem

    http://www.geeksforgeeks.org/suffix-array-set-1-introduction/ http://www.geeksforgeeks.org/pattern-s ...

  8. hd acm 1465

    问题:某人写了n封信和n个信封,如果所有的信都装错了信封.求所有的信都装错信封,共有多少种不同情况. 思路:由这道题引入错排公式:f(n)=(n-1)*[f(n-1)+f(n-2)]. 当N=1和2时 ...

  9. htmlParser的使用-链接

    基于htmlparser实现网页内容解析:http://www.cnblogs.com/coding-hundredOfYears/archive/2012/12/15/2819217.html ht ...

  10. something important

    docker run ubuntu /bin/echo 'Hello world' 运行这条命令,docker做了什么 Well, Docker containers only run as long ...