       Re: Mathematica: Weibull distribution fnc.

• To: mathgroup at smc.vnet.net
• Subject: [mg5331] Re: [mg5309] Mathematica: Weibull distribution fnc.
• From: BobHanlon at aol.com
• Date: Wed, 27 Nov 1996 01:47:46 -0500
• Sender: owner-wri-mathgroup at wolfram.com

```This shows how to work with Weibull distribution.

Bob Hanlon (Col, USAF (Retired))
______________________________________

In:=
Needs["Statistics`ContinuousDistributions`"]
Needs["Statistics`DiscreteDistributions`"]
n /: Negative[n] = False;
n /: IntegerQ[n] = True;
Off[General::spell1, General::intinit]

Let the number of failures, X, be a Poisson process with mean (mu t) where mu

is given by

In:=
mu = (1/beta) (t/beta)^(alpha - 1);

In:=
PDF[PoissonDistribution[mu t], n] // Simplify

Out=
t   alpha n
((----)     )
beta
-----------------
alpha
(t/beta)
E              n!

Let T be the time until the first failure.  Then

Pr{T <= t} = 1 - Pr{T > t} = 1 - PDF[PoissonDistribution[mu t], 0]

In:=
cdf = 1 - PDF[PoissonDistribution[mu t], 0]

Out=
-1 + alpha
-((t (t/beta)          )/beta)
1 - E

The PDF for T is then

In:=
pdf = D[cdf, t] // Simplify

Out=
t   alpha
alpha (----)
beta
-----------------
alpha
(t/beta)
E              t

In:=
PDF[WeibullDistribution[alpha, beta], t] - pdf == 0 //
PowerExpand

Out=
True

Consequently, T has a Weibull distribution.

In:=
Domain[WeibullDistribution[]]

Out=
{0, Infinity}

The exponential and Rayleigh distributions are special cases of the Weibull
distribution with alpha equal to 1 and 2 respectively:

In:=
PDF[WeibullDistribution[1, 1/lambda], x] ==
PDF[ExponentialDistribution[lambda], x]

Out=
True

In:=
PDF[WeibullDistribution[2, Sqrt sigma], x] ==
PDF[RayleighDistribution[sigma], x]

Out=
True

In:=
Mean[WeibullDistribution[alpha, beta]]

Out=
1
beta Gamma[1 + -----]
alpha

In:=
Variance[WeibullDistribution[alpha, beta]]

Out=
2               1   2               2
beta  (-Gamma[1 + -----]  + Gamma[1 + -----])
alpha               alpha

Generalized moment:

In:=
Integrate[x^t PDF[WeibullDistribution[alpha, beta], x],
{x, 0, Infinity}] // PowerExpand

Out=
t             t
beta  Gamma[1 + -----]
alpha

FORWARDED MESSAGE:

Subj:  [mg5309] Mathematica: Weibull distribution fnc.
From:  riglinbd at ml.wpafb.af.mil
To: mathgroup at smc.vnet.net
X-From: riglinbd at ml.wpafb.af.mil (Brian)
To: mathgroup at smc.vnet.net

I am trying to employ a Weibull distribution in one of the
notebooks I am working on.  However, Mathematica provides
scant if any information on how to use this function. Could
some one with more experience than I please enlighten me as
to how the Weibull distribution function found in the
Statistics'ContinuousDistribution package is used.

```

• Prev by Date: Re: Euclidean Matrix Norm
• Next by Date: Re: ComplexExpand
• Previous by thread: Mathematica: Weibull distribution fnc.
• Next by thread: Replace/No Rearrangement