expfit
Exponential parameter estimates
Syntax
muhat = expfit(data)
[muhat,muci] = expfit(data)
[muhat,muci] = expfit(data,alpha)
[…] = expfit(data,alpha,censoring)
[…) = expfit(数据、α、审查、频率)
Description
muhat = expfit(data)
estimates the mean of exponentially distributed sample data in the vectordata
.
[muhat,muci] = expfit(data)
also returns the 95% confidence interval for the mean parameter estimates inmuci
. The first row ofmuci
is the lower bound of the confidence interval, and the second row is the upper bound.
[muhat,muci] = expfit(data,alpha)
returns the 100(1–alpha
)% confidence interval for the parameter estimatemuhat
, wherealpha
is a value in the range[0 1]
specifying the width of the confidence interval. By default,alpha
is0.05
, which corresponds to the 95% confidence interval.
[…] = expfit(data,alpha,censoring)
accepts a Boolean vector,censoring
, of the same size asdata
, 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 argumentcensoring
.
[…) = expfit(数据、α、审查、频率)
accepts a frequency vector,freq
of the same size asdata
. Typically,freq
contains integer frequencies for the corresponding elements indata
, but can contain any nonnegative values. Pass in[]
foralpha
,censoring
, orfreq
to use their default values.
Examples
The following estimates the meanmu
of exponentially distributed data, and returns a 95% confidence interval for the estimate:
mu = 3; data = exprnd(mu,100,1); % Simulated data [muhat,muci] = expfit(data) muhat = 2.7511 muci = 2.2826 3.3813