expinv - Exponential inverse cumulative distribution function - MATLAB
Exponential inverse cumulative distribution function
Syntax
Description
Examples
collapse all
Assume that the lifetime of light bulbs are exponentially distributed with a mean of 700 hours. Find the median lifetime using expinv.
Half of the light bulbs will burn out within the first 485 hours of use.
Find a confidence interval estimating the median using exponentially distributed data.
Generate a sample of 1000 exponentially distributed random numbers with mean 5.
rng('default') % For reproducibility x = exprnd(5,100,1);
Estimate the mean with a confidence interval.
Estimate the variance of the mean estimate.
[~,pCov] = explike(muhat,x)
Create a confidence interval for the median.
[x,xLo,xUp] = expinv(0.5,muhat,pCov); xCi = [xLo; xUp]
Alternatively, compute a more accurate confidence interval for x by evaluating expinv on the confidence interval muci.
Input Arguments
collapse all
Probability values at which to evaluate the icdf, specified as a scalar value or an
array of scalar values, where each element is in the range
[0,1].
To evaluate the icdf at multiple values, specify
pusing an array.To evaluate the icdfs of multiple distributions, specify
muusing an array.
If either or both of the input arguments p and
mu are arrays, then the array sizes must be the same. In this
case, expinv expands each scalar input into a constant array
of the same size as the array inputs. Each
element in x is the icdf value of the distribution specified by
the corresponding element in mu, evaluated at the corresponding
element in p.
Example: [0.1,0.5,0.9]
Data Types: single | double
Mean of the exponential distribution, specified as a positive scalar value or an array of positive scalar values.
To evaluate the icdf at multiple values, specify
pusing an array.To evaluate the icdfs of multiple distributions, specify
muusing an array.
If either or both of the input arguments p and
mu are arrays, then the array sizes must be the same. In this
case, expinv expands each scalar input into a constant array
of the same size as the array inputs. Each
element in x is the icdf value of the distribution specified by
the corresponding element in mu, evaluated at the corresponding
element in p.
Example: [1 2 3 5]
Data Types: single | double
Variance of the estimate of mu, specified as a positive scalar.
You can estimate mu from data by using expfit. You can then estimate the variance of mu by
using explike. The resulting confidence
interval bounds are based on a normal approximation for the distribution of the log of
the mu estimate. You can get a more accurate set of bounds by
applying expinv to the confidence interval returned by
expfit. For an example, see Confidence Interval of Exponential icdf Value.
Example: 0.10
Data Types: single | double
Significance level for the confidence interval, specified as a scalar in the range
(0,1). The confidence level is 100(1–alpha)%, where
alpha is the probability that the confidence interval does not
contain the true value.
Example: 0.01
Data Types: single | double
Output Arguments
collapse all
icdf values evaluated at the probability values in p, returned
as a scalar value or an array of scalar values. x is the same size
as p and mu after any necessary scalar
expansion. Each element in
x is the icdf value of the distribution specified by the
corresponding element in mu, evaluated at the corresponding
element in p.
Lower confidence bound for x, returned as a scalar value or an
array of scalar values. xLo has the same size as
x.
Upper confidence bound for x, returned as a scalar value or an
array of scalar values. xUp has the same size as
x.
More About
collapse all
The exponential distribution is a one-parameter family of curves. The parameter μ is the mean.
The icdf of the exponential distribution is
The result x is the value such that an observation from an exponential distribution with parameter µ will falls in the range [0,x] with probability p. A common alternative parameterization of the exponential distribution is to use λ defined as the mean number of events in an interval as opposed to μ, which is the mean wait time for an event to occur. λ and μ are reciprocals.
For more information, see Exponential Distribution.
Alternative Functionality
expinvis a function specific to the exponential distribution. Statistics and Machine Learning Toolbox™ also offers the generic functionicdf, which supports various probability distributions. To useicdf, create anExponentialDistributionprobability distribution object and pass the object as an input argument or specify the probability distribution name and its parameters. Note that the distribution-specific functionexpinvis faster than the generic functionicdf.
Extended Capabilities
Version History
Introduced before R2006a