normfit

normfit

Normal parameter estimates

Syntax

[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)

Description

[muhat,sigmahat] = normfit(data) returns an estimate of the mean μ in muhat, and an estimate of the standard deviation σ in sigmahat, of the normal distribution given the data in data.

[muhat,sigmahat,muci,sigmaci] = normfit(data) returns 95% confidence intervals for the parameter estimates on the mean and standard deviation in the arrays muci and sigmaci, respectively. The first row of mucicontains the lower bounds of the confidence intervals for μ the second row contains the upper bounds. The first row of sigmaci contains the lower bounds of the confidence intervals for σ, and the second row contains the upper bounds.

[muhat,sigmahat,muci,sigmaci] = normfit(data,alpha) returns 100(1 - alpha) % confidence intervals for the parameter estimates, where alpha is a value in the range [0 1] specifying the width of the confidence intervals. By default, alpha is 0.05, which corresponds to 95% confidence intervals.

[...] = normfit(data,alpha,censoring) accepts a Boolean vector, censoring, of the same size as data, which is 1 for observations that are right-censored and 0 for observations that are observed exactly. data must be a vector in order to pass in the argument censoring.

[...] = normfit(data,alpha,censoring,freq) accepts a frequency vector, freq, of the same size as data. Typically, freq contains integer frequencies for the corresponding elements in data, but can contain any nonnegative values. Pass in [] for alphacensoring, or freq to use their default values.

[...] = normfit(data,alpha,censoring,freq,options) accepts a structure, options, that specifies control parameters for the iterative algorithm the function uses to compute maximum likelihood estimates when there is censoring. The normal fit function accepts an options structure which you can create using the function statset. Enter statset('normfit') to see the names and default values of the parameters that normfit accepts in theoptions structure. See the reference page for statset for more information about these options.

  • Note:   With no censoring, normfit computes muhat using the sample mean and sigmahat using the square root of the unbiased estimator of the variance. With censoring, both muhat and sigmahat are the maximum likelihood estimates.

Examples

In this example the data is a two-column random normal matrix. Both columns have µ = 10 and σ = 2. Note that the confidence intervals below contain the "true values."

data = normrnd(10,2,100,2);
[mu,sigma,muci,sigmaci] = normfit(data)
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

More About

See Also

mle | normcdf | norminv | normlike | normpdf | normrnd | normstat

Introduced before R2006a
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值