Extreme Value Distribution

Author

Eric W. Weisstein
July 30, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Statistics/ExtremeValueDistribution.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/ExtremeValueDistribution.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Stats`

<<Typesetting`

Mathematica's version (where does this come from?)

Plot

<<Graphics`Colors`

Show[
GraphicsArray[Plot[#[ExtremeValueDistribution[0,1],x],{x,-10,10},AxesLabel->TraditionalForm/@{x,#[x]},
Ticks->None,DisplayFunction->Identity,
PlotStyle->Red,PlotRange->All]&/@{PDF,CDF}
]]

Stats

Stats[ExtremeValueDistribution[a,b],x]//StatsForm//FullSimplify//TraditionalForm

Raw Moments

i[n_]:=i[n]=(-1)^n Integrate[(Log[z])^n Exp[-z],{z,0,Infinity}];
(Overscript[μ, ′])[n_]:=(Overscript[μ, ′])[n]=Sum[Binomial[n,k] a^(n-k) b^k i[k],{k,0,n}];

FullSimplify[Table[(Overscript[μ, ′])[n],{n,0,4}]]//ColumnForm//TraditionalForm

Central Moments

μ[n_]:=μ[n]=Sum[Binomial[n,j] (-1)^(n-j) (Overscript[μ, ′])[j] (Overscript[μ, ′])[1]^(n-j),{j,0,n}]

Simplify[Table[μ[n],{n,4}]]//TraditionalForm

Mean, etc.

Mean[ExtremeValueDistribution[a,b]]//TraditionalForm

Variance[ExtremeValueDistribution[a,b]]//TraditionalForm

FullSimplify[{Skewness[ExtremeValueDistribution[a,b]],μ[3]/μ[2]^(3/2)},b>0]//TraditionalForm

FullSimplify[{KurtosisExcess[ExtremeValueDistribution[a,b]],μ[4]/μ[2]^2-3},b>0]//TraditionalForm

Characteristic Function

Correct

Integrate[PDF[ExtremeValueDistribution[a,b],x]Exp[I t x],{x,-Infinity,Infinity},Assumptions->a>0&&b>0]//Timing

Not Useful

v5.0

Integrate[PDF[ExtremeValueDistribution[a,b],x]Exp[I t x],{x,-∞,∞}]//Timing

Head branch 2003/07/30

Integrate[PDF[ExtremeValueDistribution[a,b],x]Exp[I t x],{x,-∞,∞}]//Timing

Incorrect

FourierTransform[PDF[ExtremeValueDistribution[a,b],x],x,t] //Timing

InverseFourierTransform[(E^(a i t)) Gamma[1-I b t],t,x]//Timing

Uniform Distribution

CDF

Integrate[n x^(n-1),{x,0,x},Assumptions->n>1]

Normalization

Integrate[n x^(n-1),{x,0,1},Assumptions->n>0]

Raw Moments

Integrate[x^k n x^(n-1),{x,0,1},Assumptions->n>0&&k>0]

%/.k->1

Central Moment

Integrate[(((x-(n/(1+n))))^k) n x^(n-1),{x,0,1},Assumptions->n>0&&k>0&&n∈Integers&&k∈Integers]

FullSimplify[%,n∈Integers&&k∈Integers]

{m1,m2,m3,m4}=Table[Integrate[(((x-(n/(1+n))))^k) n x^(n-1),{x,0,1},Assumptions->n>0&&n∈Integers],{k,4}]//FullSimplify

Skewness

FullSimplify[m3/m2^(3/2),n>0]

Kurtosis Excess

FullSimplify[m4/m2^2-3,n>0]

Factor[%]

Plots

<<Graphics`Colors`

Plot[Evaluate[Table[(n+1)x^n,{n,6}]],{x,0,1},AxesLabel->TraditionalForm/@{x,(Subscript[P, n])[x]},
PlotStyle->{Red,Orange,Yellow,Green,Blue,Violet},PlotRange->All]

<<Statistics`DescriptiveStatistics`;
<<Graphics`Graphics`

m=Max/@Table[Random[],{10^5},{3}];

Mean[m]

Show[BarChart[BinCounts[m,{0,1,.01}],PlotRange->All,BarSpacing->0,DisplayFunction->Identity],DisplayFunction->$DisplayFunction]

Plot[4 x^3,{x,0,1},PlotRange->All]

m=Max/@Table[Random[],{10^5},{6}];

BarChart[BinCounts[m,{0,1,.01}],PlotRange->All,BarSpacing->0]

Plot[x^6,{x,0,1},PlotRange->All]

Normal Distribution

F[x_]:=Integrate[Exp[-t^2/2],{t,-∞,x}]/Sqrt[2π]

F[x]

Normalization

(n/(Sqrt[2π]))Integrate[((F[t])^(n-1))Exp[-t^2/2],{t,-∞,∞},Assumptions->n>0]

Mean

(n/(Sqrt[2π]))Integrate[t ((F[t])^(n-1))Exp[-t^2/2],{t,-∞,∞},Assumptions->n>0]

mu=Table[(n/(Sqrt[2π]))Integrate[t ((F[t])^(n-1))Exp[-t^2/2],{t,-∞,∞}],{n,3}]

Table[(n/(Sqrt[2π]))Integrate[t ((F[t])^(n-1))Exp[-t^2/2],{t,-∞,∞}],{n,4,5}]

Integrate[#,{t,-∞,∞}]&/@Expand[(1/8) (E^(-((t^2)/2))) t (((1+Erf[(t/(Sqrt[2]))]))^3)]

FullSimplify[%]

2*Sqrt[2/Pi] NIntegrate[((1/8)*t*(1+Erf[t/Sqrt[2]])^3)/E^(t^2/2),{t,-Infinity,Infinity},WorkingPrecision->25]

N[(3/(2Sqrt[π]))(1+(2/π)ArcSin[1/3]),20]

5*NIntegrate[((1/16)*t*(1+Erf[t/Sqrt[2]])^4)/E^(t^2/2),{t,-Infinity,Infinity},WorkingPrecision->25]/Sqrt[2*Pi]

N[(5/(4Sqrt[π]))(1+(6/π)ArcSin[1/3]),20]

Variance

Table[(n/(Sqrt[2π]))Integrate[(t-mu[[n]])^2 ((F[t])^(n-1))Exp[-t^2/2],{t,-∞,∞}],{n,3}]

(3/(Sqrt[2 π])) Integrate[#,{t,-∞,∞}]&/@Expand[(1/4) (E^(-((t^2)/2))) (((-(3/(2 (Sqrt[π])))+t))^2) (((1+Erf[(t/(Sqrt[2]))]))^2)]

N[((4Pi-9+2Sqrt[3])/(4π)),20]

N[(3/4)-(9/(4 π))+((3 (∫_(-∞)^∞)(1/4) (E^(-((t^2)/2))) (t^2) ((Erf[(t/(Sqrt[2]))])^2)\[DifferentialD]t)/(Sqrt[2 π])),20]

FullSimplify[((4Pi-9+2Sqrt[3])/(4π))-((3/4)-(9/(4 π)))]

FullSimplify[((2 (Sqrt[3])+π)/(4 π)) Sqrt[2Pi]4/3]

N[%,20]

NIntegrate[ (E^(-((t^2)/2))) (t^2) ((Erf[(t/(Sqrt[2]))])^2),{t,-∞,∞},WorkingPrecision->25]