Main Content

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 ofmuciis 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, wherealphais a value in the range[0 1]specifying the width of the confidence interval. By default,alphais0.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.datamust be a vector in order to pass in the argumentcensoring.

[…) = expfit(数据、α、审查、频率)accepts a frequency vector,freqof the same size asdata. Typically,freqcontains integer frequencies for the corresponding elements indata, but can contain any nonnegative values. Pass in[]foralpha,censoring, orfreqto use their default values.

Examples

The following estimates the meanmuof 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

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a