Contenuto principale

raylfit

Rayleigh parameter estimates

Description

pHat = raylfit(x) returns the maximum likelihood estimates (MLEs) of the scale parameter b of the Rayleigh distribution, given the sample data in x.

[pHat,pCI] = raylfit(x) also returns the 95% confidence intervals for the parameter estimates.

[pHat,pCI] = raylfit(x,alpha) specifies the confidence level for the confidence intervals to be 100(1 – alpha)%.

example

Examples

collapse all

Generate 100 random numbers from the Rayleigh distribution with the scale parameter b=3.

rng(0,"twister") % For reproducibility
b = 3;
x = raylrnd(b,100,1);

Find the maximum likelihood estimate and 99% confidence interval for the Rayleigh scale parameter.

[pHat,pCI] = raylfit(x,0.01)
pHat = 
3.2575
pCI = 2×1

    2.8834
    3.7337

pHat is the maximum likelihood estimate, and pCI contains the 99% confidence interval. The value in the first row is the lower bound, and the value in the second row is the upper bound.

Input Arguments

collapse all

Sample data, specified as a vector of nonnegative scalar values.

Data Types: single | double

Significance level for the confidence intervals, specified as a scalar in the range [0,1]. The confidence level is 100(1 – alpha)%, where alpha is the probability that the confidence intervals do not contain the true value. You can specify [] for alpha to use its default value of 0.05.

Data Types: single | double

Output Arguments

collapse all

Rayleigh b parameter estimate, returned as a numeric scalar.

Confidence intervals for the parameter estimate, returned as a 2-by-1 numeric array. The first row contains lower confidence bound values, and the second row contains upper confidence bound values.

Alternative Functionality

raylfit is a function specific to the Rayleigh distribution. Statistics and Machine Learning Toolbox™ also offers the generic functions mle, fitdist, and paramci and the Distribution Fitter app, which support various probability distributions.

  • mle returns MLEs and the confidence intervals of MLEs for the parameters of various probability distributions. You can specify the probability distribution name or a custom probability density function.

  • Create a RayleighDistribution probability distribution object by fitting the distribution to data using the fitdist function or the Distribution Fitter app. The object property B stores the estimate of the Rayleigh scale parameter. To obtain the confidence interval for the parameter estimate, pass the object to paramci.

References

[1] Johnson, N. L., S. Kotz, and A. W. Kemp. Univariate Discrete Distributions. Hoboken, NJ: Wiley-Interscience, 1993.

Version History

Introduced before R2006a