一、简介

正态分布Normal distribution)又名高斯分布Gaussian distribution),是一个在数学、物理及工程等领域都非常重要的概率分布,在统计学的许多方面有着重大的影响力。

若随机变量X服从一个数学期望为μ、标准方差为σ2的高斯分布,记为:

XN(μ,σ2),

则其概率密度函数为

正态分布的期望值μ决定了其位置,其标准差σ决定了分布的幅度。因其曲线呈钟形,因此人们又经常称之为钟形曲线。我们通常所说的标准正态分布是μ = 0,σ = 1的正态分布。

二、代码

(1)pdf 和 cdf函数的说明、

Probability density function(PDF) 概率密度函数;

cumulative distribution function ; CDF 是累积分布函数

(2)正态分布(normpdf normcdf)

[plain] view plaincopy
  1. clc
  2. clear all
  3. close all
  4. dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');
  5. data = dataall(:,3);%指定列
  6. [mu,sigma]=normfit(data);%estimate of the mean and standard deviation in data
  7. [y,x]=hist(data,6);%creates a histogram bar plot of data,sorts data into the number of bins specified by nbins
  8. %return the categorical levels correponding to each count in N
  9. bar(x,y,'FaceColor','r','EdgeColor','w');box off
  10. xlim([mu-3*sigma,mu+3*sigma]) % sets the axis limits in the current axes to the specified values
  11. a2=axes;
  12. % computes the pdf at each of the values in X using the normal distribution
  13. % with mean and standard deviation sigma.
  14. ezplot(@(x)normpdf(x,mu,sigma),[mu-3*sigma,mu+3*sigma])
  15. set(a2,'box','off','yaxislocation','right','color','none')
  16. title '频数直方图与正态分布密度函数(拟合)'

(3) quantile - quantile plot (Q-Q plot)

[plain] view plaincopy
  1. clc
  2. clear all
  3. close all
  4. dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');
  5. data = dataall(:,3);%指定列
  6. qqplot(data);
  7. % displays a quantile-quantile plot of the sample quantiles of X versus
  8. % theoretical from a normal distribution. if the distribution of X is
  9. % normal,the plot will be close to linear.

matlab中normfit函数进行正太分布拟合相关推荐

  1. matlab里randn是什么,matlab中randn函数用法

    matlab中randn函数用法 MATLAB 中的randn函数 matlab函数 randn:产生正态分布的随机数或矩阵的函数 randn:产生均值为0,方差σ^2 = 1,标准差σ = 1的正态 ...

  2. matlab中的fscanf函数,matlab中fscanf函数

    Matlab之print,fprint,fscanf,disp函数_数学_自然科学_专业资料.print: print 函数可以把函数图形保存成图片: minbnd = -4*pi; maxbnd = ...

  3. matlab表示520函数,MatLab中ln函数怎么表示呢

    公告: 为响应国家净网行动,部分内容已经删除,感谢读者理解. 话题:MatLab中ln函数怎么表示呢?回答:lnx表示成log(x) 而lgx表示成log10(x)话题:怎样用MATLAB语言表示ln ...

  4. matlab中randint函数用法,matlab中rand randn randint函数的区别

    matlab中rand函数是产生0到1的随机分布 matlab中randn函数是产生标准正态分布 randint是产生整数随机数,默认为0和1 %%%%%%%%%%%rand%%%%%%%%%%%%% ...

  5. matlab的newff语句,matlab 中“newff” 函数的参数设置

    matlab 中"newff" 函数的使用方法技巧|和各参数的意义 先来一个简单的源程序让大家练习一下: % Here input P and targets T define a ...

  6. matlab中label的意思,matlab中label函数

    Xlabel Ylabel Text Gtext Grid MATLAB 编程语言 Function Eval Feval Global 箭头图 绘图函数 星点图 Isletter Isspace 当 ...

  7. Matlab中bwmorph函数的使用

    Matlab中bwmorph函数的使用 Matlab中提供了一个基于形态学的处理函数,即以膨胀.腐蚀等操作为基础,其语法格式如下: bw2=bwmorph(bw1,operation,n); 其中bw ...

  8. 9.matlab中repmat函数

    来源: matlab中repmat函数的用法 - CSDN博客 https://blog.csdn.net/anqier1009/article/details/5214978 B = repmat( ...

  9. 如何在Matlab中获取函数参数的数目?

    本图文详细介绍了Matlab中获取函数参数数目的方法.

最新文章

  1. Java网络编程——11.非阻塞I/O
  2. windows tasklist 查看应用、进程
  3. android lua sd卡,记Android层执行Lua脚本的一次实践
  4. 探索GaussDB(DWS)的过程化SQL语言能力
  5. 2021牛客寒假算法基础集训营3,签到题DGHIJ
  6. 七牛2015结姻大典,约吗?
  7. 一步之遥 c语言答案是多少,蓝桥杯之一步之遥-Go语言中文社区
  8. 斐讯k2修改dns服务器,斐讯K2固件修改的一些信息
  9. 统计学计算机app,统计学计算器
  10. 【无标题】123321
  11. 计算机内存读取写入原理是什么
  12. 如何在职场人际冲突中“立于不败之地”?
  13. abaqus帮助html,ABAQUS/CAE 常 问 界 面 操 作(转自SimWe仿真论坛
  14. 企业为什么要通过直播来做营销呢?
  15. 编程时java找不到文件_java.io.FileNotFoundException:系统找不到指定的文件
  16. snkrs暂时无法链接服务器,安卓snkrs一直出错了怎么解决 苹果snkrs无法连接服务器什么原因...
  17. 更改或者重置linux 系统 root 密码
  18. 在领悟到什么道理后,你的人生从此轻松了起来?
  19. 计算机报声音怎么弄,excel表格输入数据报语音-excel的语音报数怎么弄出来?
  20. 程序员必备网站和工具

热门文章

  1. 智慧园区建设新方案:人脸识别智能门禁+手机梯控+访客管理系统
  2. express之multer文件上传
  3. pc端vue登录如何调用软键盘_使用vue实现简单键盘的示例(支持移动端和pc端)
  4. PTA L1-069 胎压监测
  5. css导航栏悬浮在轮播图上面,如何设置半透明悬浮效果
  6. torch.conv2d 参数解析与 NumPy 复现
  7. html输出函数值,Excel中如何把函数输出来的值变成真正的数值?
  8. JavaScript Promise对象详解
  9. Java中static关键字的作用
  10. 大规模优化算法 - LBFGS算法