Function File: mu = expfit (s)
Function File: [mu, ci] = expfit (s)
Function File: [mu, ci] = expfit (s, alpha)
Function File: … = expfit (s, alpha, c)
Function File: … = expfit (s, alpha, c, f)

Estimate the mean of the exponential probability distribution function from which sample data s has been taken. s is expected to be a non-negative vector. If s is an array, the mean will be computed for each column of s. If any elements of s are NaN, that vector’s mean will be returned as NaN.

If the optional output variable ci is requested, expfit will also return the confidence interval bounds for the estimate as a two element column vector. If s is an array, each column of data will have a confidence interval returned as a two row array.

The optional scalar input alpha can be used to define the (1-alpha) confidence interval to be applied to all estimates as a value between 0 and 1. The default is 0.05, resulting in a 0.95 or 95% CI. Any invalid values for alpha will return NaN for both CI bounds.

The optional input c is a logical or numeric array of zeros and ones the same size as s, used to right-censor individual elements of s. A value of 1 indicates the data should be censored from the mean estimation. Any nonzero values in c are treated as a 1.

The optional input f is a numeric array the same size as s, used to specify occurrence frequencies for the elements in s. Values of f need not be integers. Any NaN elements in the frequency array will produce a NaN output for mu.

Options can be skipped by using [] to revert to the default.

Matlab incompatibility: Matlab’s expfit produces unpredictable results for some cases with higher dimensions (specifically 1 x m x n x ... arrays). Octave’s implementation allows for n-D arrays, consistently performing calculations on individual column vectors. Additionally, c and f can be used with arrays of any size, whereas Matlab only allows their use when s is a vector.

See also: expcdf, expinv, explike, exppdf, exprnd, expstat.

See also: expstat, exprnd, expcdf, expinv.

Package: statistics