Weibulldf: Difference between revisions
imported>Jeremy No edit summary |
imported>Bob |
||
(2 intermediate revisions by one other user not shown) | |||
Line 13: | Line 13: | ||
This distribution is used to model lifetime data (time to failure). It is skewed to the right, but may appear symmetric for data in which there are relatively no small outcomes. Negative values in the sample are ignored. | This distribution is used to model lifetime data (time to failure). It is skewed to the right, but may appear symmetric for data in which there are relatively no small outcomes. Negative values in the sample are ignored. | ||
::<math>f(x) = \left ( b x^{b-1}/a^b \right) \exp \left [ - \left ( x/a \right )^b \right ]</math> | |||
::<math>F(x) = 1 - \exp \left [ - \left ( x/a \right ) ^b \right ]</math> | |||
====Inputs==== | ====Inputs==== | ||
Line 35: | Line 39: | ||
===Examples=== | ===Examples=== | ||
====Cumulative | ====Cumulative==== | ||
<pre> | <pre> | ||
>> prob = weibulldf('c',2,1,2) | >> prob = weibulldf('c',2,1,2) | ||
Line 43: | Line 47: | ||
>> plot(x,weibulldf('c',x,1,2),'b-',x,weibulldf('c',x,3,7),'r-') | >> plot(x,weibulldf('c',x,1,2),'b-',x,weibulldf('c',x,3,7),'r-') | ||
</pre> | </pre> | ||
====Density | ====Density==== | ||
<pre> | <pre> | ||
>> prob = weibulldf('d',2,1,1) | >> prob = weibulldf('d',2,1,1) | ||
Line 51: | Line 55: | ||
>> plot(x,weibulldf('d',x,2,1),'b-',x,weibulldf('d',x,0.5,1),'r-') | >> plot(x,weibulldf('d',x,2,1),'b-',x,weibulldf('d',x,0.5,1),'r-') | ||
</pre> | </pre> | ||
====Quantile | ====Quantile==== | ||
<pre> | <pre> | ||
>> prob = weibulldf('q',0.5,1,2) | >> prob = weibulldf('q',0.5,1,2) | ||
Line 57: | Line 61: | ||
0.8326 | 0.8326 | ||
</pre> | </pre> | ||
====Random | ====Random==== | ||
<pre> | <pre> | ||
>> prob = weibulldf('r',[4 1],2,1) | >> prob = weibulldf('r',[4 1],2,1) | ||
Line 65: | Line 69: | ||
1.0562 | 1.0562 | ||
4.4820 | 4.4820 | ||
</pre> | |||
===See Also=== | |||
[[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]] | [[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]] |
Latest revision as of 13:18, 10 October 2008
Purpose
Weibull distribution.
Synopsis
- prob = weibulldf(function,x,a,b)
Description
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Weibull distribution.
This distribution is used to model lifetime data (time to failure). It is skewed to the right, but may appear symmetric for data in which there are relatively no small outcomes. Negative values in the sample are ignored.
Inputs
- function = [ {'cumulative'} | 'density' | 'quantile' | 'random' ], defines the functionality to be used. Note that the function recognizes the first letter of each string so that the string could be: [ 'c' | 'd' | 'q' | 'r' ].
- x = matrix in which the sample data is stored, in the interval (-inf,inf).
- for function=quantile - matrix with values in the interval (0,1).
- for function=random - vector indicating the size of the random matrix to create.
- a = scale parameter (real).
- b = shape parameter (real and positive).
Note: If inputs (x, a, and b) are not equal in size, the function will attempt to resize all inputs to the largest input using the RESIZE function.
Note: Functions will typically allow input values outside of the acceptable range to be passed but such values will return NaN in the results.
Examples
Cumulative
>> prob = weibulldf('c',2,1,2) prob = 0.9817 >> x = [0:0.1:10]; >> plot(x,weibulldf('c',x,1,2),'b-',x,weibulldf('c',x,3,7),'r-')
Density
>> prob = weibulldf('d',2,1,1) prob = 0.1353 >> x = [0:0.1:10]; >> plot(x,weibulldf('d',x,2,1),'b-',x,weibulldf('d',x,0.5,1),'r-')
Quantile
>> prob = weibulldf('q',0.5,1,2) prob = 0.8326
Random
>> prob = weibulldf('r',[4 1],2,1) ans = 5.4812 4.9755 1.0562 4.4820
See Also
betadf, cauchydf, chidf, expdf, gammadf, gumbeldf, laplacedf, logisdf, lognormdf, normdf, paretodf, raydf, triangledf, unifdf