主要内容

wblinv

Weibull inverse cumulative distribution function

Description

x = wblinv(p) returns the inverse cumulative distribution function (icdf) of the Weibull distribution with unit scale and shape parameters, evaluated at the probability values in p.

x = wblinv(p,a,b) returns the icdf using the scale parameter a and shape parameter b, evaluated at the probability values in p.

example

[p,pLo,pUp] = wblinv(x,a,b,pCov) also returns the 95% confidence bounds [pLo,pUp] of p when a and b are estimates. pCov is a 2-by-2 covariance matrix of the estimated parameters.

example

[p,pLo,pUp] = wblinv(x,a,b,pCov,alpha) specifies the confidence level for the confidence interval [pLo,pUp] to be 100(1 – alpha)%.

Examples

collapse all

Compute the inverse cdf (icdf) values evaluated at the probability values in p for the Weibull distribution with the scale parameter a and shape parameter b.

p = 0.005:0.01:0.995;
a = 8;
b = 3;
x = wblinv(p,a,b);

Plot the icdf.

plot(p,x)
grid on
xlabel("p");
ylabel("x");

Figure contains an axes object. The axes object with xlabel p, ylabel x contains an object of type line.

Find a confidence interval estimating the median using Weibull distributed data.

Generate a sample of 500 Weibull distributed random numbers with the scale parameter a and shape parameter b.

a = 3;
b = 4;
x = wblrnd(a,b,500,1);

Compute estimates for the parameters.

params = wblfit(x)
params = 1×2

    3.0042    4.2444

Store the estimates for the parameters as aHat and bHat.

aHat = params(1);
bHat = params(2);

Compute the covariance of the parameter estimates.

[~,pCov] = wbllike(params,x)
pCov = 2×2

    0.0011    0.0015
    0.0015    0.0220

Create a confidence interval estimating x.

[x,xLo,xUp] = wblinv(0.50,aHat,bHat,pCov)
x = 
2.7557
xLo = 
2.6897
xUp = 
2.8233

Input Arguments

collapse all

Probability values at which to evaluate the inverse of the cdf (icdf), specified as a scalar value or an array of scalar values in the range [0,1].

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify a and b using arrays. If one or more of the input arguments p, a, and b are arrays, then the array sizes must be the same. In this case, wblinv 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 elements in a and b, evaluated at the corresponding element in p.

Data Types: single | double

Scale parameter, specified as a positive scalar or an array of positive scalars. If you specify pCov to compute the confidence interval [pLo,pUp], then a must be a scalar.

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify a and b using arrays. If one or more of the input arguments p, a, and b are arrays, then the array sizes must be the same. In this case, wblinv 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 elements in a and b, evaluated at the corresponding element in p.

Data Types: single | double

Shape parameter, specified as a positive scalar or an array of positive scalars. If you specify pCov to compute the confidence interval [pLo,pUp], then b must be a scalar.

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify a and b using arrays. If one or more of the input arguments p, a, and b are arrays, then the array sizes must be the same. In this case, wblinv 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 elements in a and b, evaluated at the corresponding element in p.

Data Types: single | double

Covariance of the estimates a and b, specified as a 2-by-2 matrix.

If you specify pCov to compute the confidence interval [pLo,pUp], then x, a, and b must be scalar values.

You can estimate a and b by using mle, and estimate the covariance of a and b by using wbllike.

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.

Data Types: single | double

Output Arguments

collapse all

Inverse cdf values evaluated at the probabilities in p, returned as a scalar value or an array of scalar values. x is the same size as p, a, and b after any necessary scalar expansion. Each element in x is the inverse cdf value of the distribution specified by the corresponding elements in a and b, evaluated at the corresponding probability in p.

Lower confidence bound for p, returned as a scalar value or an array of scalar values. pLo has the same size as x.

Upper confidence bound for p, returned as a scalar value or an array of scalar values. pUp has the same size as x.

More About

collapse all

Algorithms

The wblinv function computes confidence bounds for x using a normal approximation to the distribution of the estimate

loga^+logqb^

where q is the Pth quantile from a Weibull distribution with scale and shape parameters both equal to 1. The computed bounds give approximately the intended confidence level when you estimate a, b, and pCov from large samples. In smaller samples, other methods of computing the confidence bounds might be more accurate.

Alternative Functionality

  • wblinv is a function specific to the Weibull distribution. Statistics and Machine Learning Toolbox™ also offers the generic function icdf, which supports various probability distributions. To use icdf, create a WeibullDistribution probability distribution object and pass the object as an input argument or specify the probability distribution name and its parameters. Note that the distribution-specific function wblinv is faster than the generic function icdf.

Extended Capabilities

expand all

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

Version History

Introduced before R2006a