Weibulldf: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Bob
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===


Line 14: 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====


* '''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' ].
* '''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).  
* '''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=quantile - matrix with values in the interval (0,1).
:: for function=random - vector indicating the size of the random matrix to create.
 
*  '''for''' function=random - vector indicating the size of the random matrix to create.


* '''a''' = scale parameter (real).
* '''a''' = scale parameter (real).
Line 38: Line 39:
===Examples===
===Examples===


====Cumulative:====
====Cumulative====
 
<pre>
>> prob = weibulldf('c',2,1,2)
>> prob = weibulldf('c',2,1,2)
prob =
prob =
     0.9817
     0.9817
>> x    = [0:0.1:10];
>> x    = [0:0.1:10];
>> 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>
====Density:====
====Density====
 
<pre>
>> prob = weibulldf('d',2,1,1)
>> prob = weibulldf('d',2,1,1)
prob =
prob =
     0.1353
     0.1353
>> x    = [0:0.1:10];
>> x    = [0:0.1:10];
>> 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>
====Quantile:====
====Quantile====
 
<pre>
>> prob = weibulldf('q',0.5,1,2)
>> prob = weibulldf('q',0.5,1,2)
prob =
prob =
     0.8326
     0.8326
 
</pre>
====Random:====
====Random====
 
<pre>
>> prob = weibulldf('r',[4 1],2,1)
>> prob = weibulldf('r',[4 1],2,1)
ans =
ans =
     5.4812
     5.4812
     4.9755
     4.9755
     1.0562
     1.0562
     4.4820
     4.4820
</pre>


===See Also===
===See Also===


[[betadr]], [[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