Raydf: Difference between revisions
imported>Jeremy (Importing text file) |
imported>Bob |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Line 14: | Line 13: | ||
This distribution is commonly used to model lifetime data (time to failure). It is skewed to the right and the variance is usually larger than the mean (though it can be smaller or equal). Negative values in the sample are ignored. | This distribution is commonly used to model lifetime data (time to failure). It is skewed to the right and the variance is usually larger than the mean (though it can be smaller or equal). Negative values in the sample are ignored. | ||
::<math>f(x) = \left ( x/a^2 \right ) \exp \left [ -x^2/ \left ( 2a^2 \right ) \right ]</math> | |||
::<math>F(x) = 1 - \exp \left [ -x^2 / \left ( 2a^2 \right ) \right ]</math> | |||
====Inputs==== | ====Inputs==== | ||
Line 23: | Line 28: | ||
* '''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=random - vector indicating the size of the random matrix to create. | |||
* '''a''' = scale parameter (real). | * '''a''' = scale parameter (real). | ||
Line 32: | Line 35: | ||
'''Note''': If inputs (x and a) are not equal in size, the function will attempt to resize all inputs to the largest input using the RESIZE function. | '''Note''': If inputs (x and a) 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. | '''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=== | ===Examples=== | ||
====Cumulative | ====Cumulative==== | ||
<pre> | |||
>> prob = raydf('c',2,1) | >> prob = raydf('c',2,1) | ||
prob = | prob = | ||
0.8647 | 0.8647 | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,raydf('c',x,1),'b-',x,raydf('c',x,3),'r-') | >> plot(x,raydf('c',x,1),'b-',x,raydf('c',x,3),'r-') | ||
</pre> | |||
====Density | ====Density==== | ||
<pre> | |||
>> prob = raydf('d',2,1) | >> prob = raydf('d',2,1) | ||
prob = | prob = | ||
0.2707 | 0.2707 | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,raydf('d',x,2),'b-',x,raydf('d',x,0.5),'r-') | >> plot(x,raydf('d',x,2),'b-',x,raydf('d',x,0.5),'r-') | ||
</pre> | |||
====Quantile | ====Quantile==== | ||
<pre> | |||
>> prob = raydf('q',0.5,1) | >> prob = raydf('q',0.5,1) | ||
prob = | prob = | ||
1.1774 | 1.1774 | ||
</pre> | |||
====Random | ====Random==== | ||
<pre> | |||
>> prob = raydf('r',[4 1],2) | >> prob = raydf('r',[4 1],2) | ||
ans = | ans = | ||
4.2135 | 4.2135 | ||
3.3893 | 3.3893 | ||
2.2085 | 2.2085 | ||
0.3865 | 0.3865 | ||
</pre> | |||
===See Also=== | ===See Also=== | ||
[[ | [[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[normdf]], [[paretodf]], [[triangledf]], [[unifdf]], [[weibulldf]] |
Latest revision as of 08:45, 10 October 2008
Purpose
Rayleigh distribution.
Synopsis
- prob = raydf(function,x,a)
Description
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Rayleigh distribution.
This distribution is commonly used to model lifetime data (time to failure). It is skewed to the right and the variance is usually larger than the mean (though it can be smaller or equal). 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).
Note: If inputs (x and a) 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 = raydf('c',2,1) prob = 0.8647 >> x = [0:0.1:10]; >> plot(x,raydf('c',x,1),'b-',x,raydf('c',x,3),'r-')
Density
>> prob = raydf('d',2,1) prob = 0.2707 >> x = [0:0.1:10]; >> plot(x,raydf('d',x,2),'b-',x,raydf('d',x,0.5),'r-')
Quantile
>> prob = raydf('q',0.5,1) prob = 1.1774
Random
>> prob = raydf('r',[4 1],2) ans = 4.2135 3.3893 2.2085 0.3865
See Also
betadf, cauchydf, chidf, expdf, gammadf, gumbeldf, laplacedf, logisdf, lognormdf, normdf, paretodf, triangledf, unifdf, weibulldf