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[1]:=
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[6]:=
mu = (1/beta) (t/beta)^(alpha - 1);
In[7]:=
PDF[PoissonDistribution[mu t], n] // Simplify
Out[7]=
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[8]:=
cdf = 1 - PDF[PoissonDistribution[mu t], 0]
Out[8]=
-1 + alpha
-((t (t/beta) )/beta)
1 - E
The PDF for T is then
In[9]:=
pdf = D[cdf, t] // Simplify
Out[9]=
t alpha
alpha (----)
beta
-----------------
alpha
(t/beta)
E t
In[10]:=
PDF[WeibullDistribution[alpha, beta], t] - pdf == 0 //
PowerExpand
Out[10]=
True
Consequently, T has a Weibull distribution.
In[11]:=
Domain[WeibullDistribution[]]
Out[11]=
{0, Infinity}
The exponential and Rayleigh distributions are special cases of the Weibull
distribution with alpha equal to 1 and 2 respectively:
In[12]:=
PDF[WeibullDistribution[1, 1/lambda], x] ==
PDF[ExponentialDistribution[lambda], x]
Out[12]=
True
In[13]:=
PDF[WeibullDistribution[2, Sqrt[2] sigma], x] ==
PDF[RayleighDistribution[sigma], x]
Out[13]=
True
In[14]:=
Mean[WeibullDistribution[alpha, beta]]
Out[14]=
1
beta Gamma[1 + -----]
alpha
In[15]:=
Variance[WeibullDistribution[alpha, beta]]
Out[15]=
2 1 2 2
beta (-Gamma[1 + -----] + Gamma[1 + -----])
alpha alpha
Generalized moment:
In[16]:=
Integrate[x^t PDF[WeibullDistribution[alpha, beta], x],
{x, 0, Infinity}] // PowerExpand
Out[16]=
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.