Raydf

From Eigenvector Documentation Wiki
Jump to: navigation, search

Contents

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.


f(x) = \left ( x/a^2 \right ) \exp \left [ -x^2/ \left ( 2a^2 \right ) \right ]


F(x) = 1 - \exp \left [ -x^2 / \left ( 2a^2 \right ) \right ]


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

Views
Personal tools