Class WeibullDistribution
java.lang.Object
smile.stat.distribution.WeibullDistribution
- All Implemented Interfaces:
- Serializable, Distribution
The Weibull distribution is one of the most widely used lifetime distributions
in reliability engineering. It is a versatile distribution that can take on
the characteristics of other types of distributions, based on the value of
the shape parameter. The distribution has two parameters: 
k > 0
is the shape parameter and λ > 0 is the scale parameter
of the distribution. The probability density function is
f(x;λ,k) = k/λ (x/λ)k-1e-(x/λ)^k
for x >= 0.
The Weibull distribution is often used in the field of life data analysis
due to its flexibility - it can mimic the behavior of other statistical
distributions such as the normal and the exponential. If the failure rate
decreases over time, then k < 1. If the failure rate is
constant over time, then k = 1. If the failure rate increases
over time, then k > 1.
An understanding of the failure rate may provide insight as to what is causing the failures:
- A decreasing failure rate would suggest "infant mortality". That is, defective items fail early and the failure rate decreases over time as they fall out of the population.
- A constant failure rate suggests that items are failing from random events.
- An increasing failure rate suggests "wear out" - parts are more likely to fail as time goes on.
-  When k = 1, it is the exponential distribution.
-  When k = 2, it becomes equivalent to the Rayleigh distribution, which models the modulus of a two-dimensional uncorrelated bivariate normal vector.
-  When k = 3.4, it appears similar to the normal distribution.
- As k goes to infinity, the Weibull distribution asymptotically approaches the Dirac delta function.
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionWeibullDistribution(double k) Constructor.WeibullDistribution(double k, double lambda) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptiondoublecdf(double x) Cumulative distribution function.doubleentropy()Returns Shannon entropy of the distribution.intlength()Returns the number of parameters of the distribution.doublelogp(double x) The density at x in log scale, which may prevents the underflow problem.doublemean()Returns the mean of distribution.doublep(double x) The probability density function for continuous distribution or probability mass function for discrete distribution at x.doublequantile(double p) The quantile, the probability to the left of quantile is p.doublerand()Generates a random number following this distribution.toString()doublevariance()Returns the variance of distribution.Methods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface DistributioninverseTransformSampling, likelihood, logLikelihood, quantile, quantile, rand, rejectionSampling, sd
- 
Field Details- 
kpublic final double kThe shape parameter.
- 
lambdapublic final double lambdaThe scale parameter.
 
- 
- 
Constructor Details- 
WeibullDistributionpublic WeibullDistribution(double k) Constructor. The default scale parameter is 1.0.- Parameters:
- k- the shape parameter.
 
- 
WeibullDistributionpublic WeibullDistribution(double k, double lambda) Constructor.- Parameters:
- k- the shape parameter.
- lambda- the scale parameter.
 
 
- 
- 
Method Details- 
lengthpublic int length()Description copied from interface:DistributionReturns the number of parameters of the distribution. The "length" is in the sense of the minimum description length principle.- Specified by:
- lengthin interface- Distribution
- Returns:
- The number of parameters.
 
- 
meanpublic double mean()Description copied from interface:DistributionReturns the mean of distribution.- Specified by:
- meanin interface- Distribution
- Returns:
- The mean.
 
- 
variancepublic double variance()Description copied from interface:DistributionReturns the variance of distribution.- Specified by:
- variancein interface- Distribution
- Returns:
- The variance.
 
- 
entropypublic double entropy()Description copied from interface:DistributionReturns Shannon entropy of the distribution.- Specified by:
- entropyin interface- Distribution
- Returns:
- Shannon entropy.
 
- 
toString
- 
randpublic double rand()Description copied from interface:DistributionGenerates a random number following this distribution.- Specified by:
- randin interface- Distribution
- Returns:
- a random number.
 
- 
ppublic double p(double x) Description copied from interface:DistributionThe probability density function for continuous distribution or probability mass function for discrete distribution at x.- Specified by:
- pin interface- Distribution
- Parameters:
- x- a real number.
- Returns:
- the density.
 
- 
logppublic double logp(double x) Description copied from interface:DistributionThe density at x in log scale, which may prevents the underflow problem.- Specified by:
- logpin interface- Distribution
- Parameters:
- x- a real number.
- Returns:
- the log density.
 
- 
cdfpublic double cdf(double x) Description copied from interface:DistributionCumulative distribution function. That is the probability to the left of x.- Specified by:
- cdfin interface- Distribution
- Parameters:
- x- a real number.
- Returns:
- the probability.
 
- 
quantilepublic double quantile(double p) Description copied from interface:DistributionThe quantile, the probability to the left of quantile is p. It is actually the inverse of cdf.- Specified by:
- quantilein interface- Distribution
- Parameters:
- p- the probability.
- Returns:
- the quantile.
 
 
-