首页 技术 正文
技术 2022年11月21日
0 收藏 701 点赞 4,504 浏览 797 个字

正态分布(Normal Distribution)

1、正态分布是一种连续分布,其函数可以在实线上的任何地方取值。

2、正态分布由两个参数描述:分布的平均值μ和方差σ2

3、正态分布的取值可以从负无穷到正无穷。

3、Z-score 是非标准正态分布标准化后的x 即 z = (x−μ) / σ

#显示标准正态分布曲线图

 import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt mu = 0 # mean
sigma = 1 # standart deviation
x = np.arange(-5, 5, 0.1)
y = stats.norm.pdf(x, 0, 1)
print('Chart 1:')
plt.plot(x, y)
plt.title('Normal: $\mu$ = {0:.1f}, $\sigma^2$ = {1:0.1f}'.format(mu, sigma))
plt.xlabel('x')
plt.ylabel('Probability density') # probobility of observing each of these observations
plt.show()

用Python学分析 – 正态分布

标准正态分布表

表头的横向表示小数点后第二位,表头的纵向则为整数部分以及小数点后第一位;两者联合作为完整的x,坐标轴的横轴

# 显示标准正态分布表格

 import numpy as np
from scipy.stats import norm n = 100
x = np.arange(0, 0.1, 0.01)
y = np.arange(0, 3.1, 0.1)
print('z表 ', end = '')
for j in x:
print( str(j), end=' ')
print()
for i in y:
print( i , end = ': ')
for j in x:
z = norm.cdf(j+i)
print('{0:.4f}'.format(z), end = ' ')
print('')

用Python学分析 – 正态分布

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,994
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,507
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,350
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,135
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,768
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,845