使用方法:

[muhat, sigmahat] = normfit(data)

[muhat, sigmahat, muci, sigmaci] = normfit(data)

[muhat, sigmahat, muci, sigmaci] = normfit(data, alpha)

[...] = normfit(data, alpha, censoring)

[...] = normfit(data, alpha, censoring, freq)

[...] = normfit(data, alpha, censoring, freq, options)

说明:

[muhat, sigmahat] = normfit(data) 返回给定数据data的正态分布均值μ 和标准差σ

的参数估计。

[muhat, sigmahat, muci, sigmaci] = normfit(data, alpha)

返回置信度区间为100(1 - alpha) % 的参数估计,这里alpha 是一个[0

1]范围内的值,由置信区间宽度决定。默认alpha 是0.05,对应95%的置信度区间。

=================================================================================================

matlab中normfit在正态分布中的使用技巧如下:

函数 normfit

格式 [muhat,sigmahat,muci,sigmaci] = normfit(X)

[muhat,sigmahat,muci,sigmaci] = normfit(X,alpha)

说明

muhat,sigmahat分别为正态分布的参数μ和σ的估计值,muci,sigmaci分别为置信区间,其置信度为;alpha给出显著水平α,缺省时默认为0.05,即置信度为95%.

例4-62 有两组(每组100个元素)正态随机数据,其均值为10,均方差为2,求95%的置信区间和参数估计值.

解:>>r = normrnd (10,2,100,2);

%产生两列正态随机数据

>>[mu,sigma,muci,sigmaci] =

normfit(r)

则结果为

mu =

10.1455 10.0527 %各列的均值的估计值

sigma =

1.9072 2.1256 %各列的均方差的估计值

muci =

9.7652 9.6288

10.5258 10.4766

sigmaci =

1.6745 1.8663

2.2155 2.4693

说明 muci,sigmaci中各列分别为原随机数据各列估计值的置信区间,置信度为95%.

例4-63 分别使用金球和铂球测定引力常数

(1)用金球测定观察值为:6.683 6.681 6.676 6.678 6.679 6.672

(2)用铂球测定观察值为:6.661 6.661 6.667 6.667 6.664

设测定值总体为,μ和σ为未知.对(1),(2)两种情况分别求μ和σ的置信度为0.9的置信区间.

解:建立M文件:LX0833.m

X=[6.683 6.681 6.676 6.678 6.679 6.672];

Y=[6.661 6.661 6.667 6.667 6.664];

[mu,sigma,muci,sigmaci]=normfit(X,0.1) %金球测定的估计

[MU,SIGMA,MUCI,SIGMACI]=normfit(Y,0.1) %铂球测定的估计

运行后结果显示如下:

mu =

6.6782

sigma =

0.0039

muci =

6.6750

6.6813

sigmaci =

0.0026

0.0081

MU =

6.6640

SIGMA =

0.0030

MUCI =

6.6611

6.6669

SIGMACI =

0.0019

0.0071

由上可知,金球测定的μ估计值为6.6782,置信区间为[6.6750,6.6813];

σ的估计值为0.0039,置信区间为[0.0026,0.0081].

泊球测定的μ估计值为6.6640,置信区间为[6.6611,6.6669];

σ的估计值为0.0030,置信区间为[0.0019,0.0071].

===============================================================================================

而normpdf是求概率密度函数

normpdf - Normal probability density

function

Syntax

Y = normpdf(X,mu,sigma)

Y = normpdf(X)

Y = normpdf(X,mu)

Description

Y =

normpdf(X,mu,sigma) computes the pdf at each of the values in

X using the normal distribution with mean mu and

standard deviation sigma. X, mu, and

sigma can be vectors, matrices, or multidimensional arrays

that all have the same size. A scalar input is expanded to a

constant array with the same dimensions as the other inputs. The

parameters in sigma must be positive.

The normal pdf is

The likelihood function is the pdf viewed

as a function of the parameters. Maximum likelihood estimators

(MLEs) are the values of the parameters that maximize the

likelihood function for a fixed value of x.

The standard normal distribution has

μ = 0 and σ = 1.

If x is standard normal, then

xσ + μ is also normal with mean

μ and standard deviation σ. Conversely, if

y is normal with mean μ and standard

deviation σ, then x =

(y-μ) / σ

is standard normal.

Y = normpdf(X) uses the standard normal distribution

(mu = 0,

sigma = 1).

Y = normpdf(X,mu) uses the normal distribution with

unit standard deviation

(sigma = 1).

Examples

mu = [0:0.1:2];

[y i] = max(normpdf(1.5,mu,1));

MLE = mu(i)

MLE =

1.5000

matlab的normpdf,normfit和normpdf用法相关推荐

  1. Matlab里evalin和assignin的用法

    原文地址:Matlab里evalin和assignin的用法作者:了凡春秋 assignin与evalin     MATLAB通常的基本工作空间是'base'空间.MATLAB在程序运行过程中,将为 ...

  2. matlab fopen函数的用法,matlab中关于fread函数的用法

    公告: 为响应国家净网行动,部分内容已经删除,感谢读者理解. 话题:matlab中关于fread函数的用法 问题详情:用fread打开一个时,需要不需要把开放在某个特回答:必须在Matlab可以搜索的 ...

  3. 【MATLAB】柱状图(bar的用法)

    [MATLAB]柱状图(bar的用法) 语法: [1]bar(y) [2]bar(x,y) [3]barh(y,属性) 先举例: >> x=0:0.1:2*pi; >> y=c ...

  4. Matlab中sub2ind函数原理及用法!

    Matlab中sub2ind函数原理及用法!

  5. matlab中uint16(uint8)函数的用法

    matlab中uint16函数的用法: 1.函数用法:将输入参数映射到无符号16位范围之内,即将参数限定在0-65535之间: 2.实例:当输入为一个实数a时: if a<0 输出ans=0; ...

  6. matlab中find()函数用法

    一.基本用法 返回矩阵或向量中非零元素的索引 注意:matlab中下标从1开始 举例: (1)向量 返回非零元素下标 find(vector) x=[1 2 3 0 0 6 7 8 9]; find( ...

  7. matlab randomsample,randperm和randsample函数用法对比

    构建替代数据的时候,一种常见的思路是打乱原数据的排列次序,通过随机置换原数据的排列次序从而产生和原数据系列统计特征(如均值.方差.分布)一致的随机数据.具体到Matlab中,此思路的实现会涉及到两个命 ...

  8. matlab中Svmtrain和Svmpredict的用法

    一. svmtrain 的用法 svmtrain实现对训练数据集的训练,获得SVM模型. 用法: svmtrain [options] training_set_file [model_file] 其 ...

  9. Matlab神经网络函数newff()新旧用法差异

    声明!!!转载自: http://www.cnblogs.com/xxfcz/p/4482813.html 摘要 在Matlab R2010a版中,如果要创建一个具有两个隐含层.且神经元数分别为5.3 ...

最新文章

  1. 在WPF应用程序中利用IEditableObject接口实现可撤销编辑的对象
  2. 【Win 10 应用开发】UI Composition 札记(二):基本构件
  3. Java(CS)请求分流
  4. 盖茨推荐人人该读的九本书
  5. Delphi面向对象学习随笔六:接口
  6. Django--form验证及错误处理
  7. 关于J2EE中死锁问题的研究(2)
  8. python如何创建excel文件_Python xlrd/xlwt 创建excel文件及常用操作
  9. java 延迟实例化_延迟初始化Spring Bean的几种方式
  10. vue基础(学习官方文档)
  11. 漫步最优化二十二——收敛速率
  12. 百度的一道 java 高频面试题的多种解法
  13. ios8正式版固件开放下载 有哪些亮点?
  14. 小学计算机课知识点内容,小学信息技术教案九篇
  15. “萝卜快跑”,“快”不起来——百度Robotaxi试乘体验
  16. 最强大脑世界记忆大师运用的记忆方法
  17. 酷狗及一些播放软件收费歌曲下载方法
  18. C++ access( )函数
  19. Python数据可视化案例:分析微信公众号数据
  20. CRX 4 Chrome

热门文章

  1. 免费网络硬盘绝对免费
  2. mongodb 集群shard_【mongoDB运维篇④】Shard分片集群
  3. 成为更好程序员的7个方法
  4. DM365IPNC开发环境搭建
  5. 世界上最牛的电脑天才 ,其能力和水平不服都不行!
  6. 邮件合并在打印学生信封上的应用
  7. com.alibaba.easyexcel.support.cglib.core.CodeGenerationException
  8. 【React】895- 使用 IOC 解耦 React 组件
  9. Lucene系列:(11)异步分页
  10. Android小Demo——通过MQTT协议连接OneNet平台(新版)