Triangular Distribution

Author

Eric W. Weisstein
October 10, 2005

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

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

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

Definition

v5

TriangularDistribution/:Domain[TriangularDistribution[a_,b_,c_]]:=Interval[a,b]

TriangularDistribution/:PDF[TriangularDistribution[a_,b_,c_],x_]:=Piecewise[{{((2(x-a))/((b-a)(c-a))),a≤x≤c},{((2(b-x))/((b-a)(b-c))),c≤x≤b}}]

TriangularDistribution/:CDF[TriangularDistribution[a_,b_,c_],x_]:=Piecewise[{{((((a-x))^2)/((a-b) (a-c))) ,a≤x≤c},{1+((((b-x))^2)/((a-b) (b-c))),c≤x≤b}}]

TriangularDistribution/:Mean[TriangularDistribution[a_,b_,c_]]:=(a+b+c)/3
TriangularDistribution/:Variance[TriangularDistribution[a_,b_,c_]]:=(a^2-a b+b^2-a c-b c+c^2)/18

v6

<<Statistics`ContinuousDistributions`

?TriangularDistribution

Plot

Show[GraphicsArray[
Block[{$DisplayFunction=Identity},
Plot[#[TriangularDistribution[0,1,1/3],x],{x,0,1},AxesLabel->TraditionalForm/@{x,#[x]},PlotStyle->Red,Ticks->None]&/@{PDF,CDF}
]],ImageSize->450]

PDF

v6

PDF[TriangularDistribution[a,b,c],x]

CDF

v5.2

Simplify[Integrate[((2(x-a))/((b-a)(c-a))),{x,a,x}]]

Simplify[Integrate[((2(x-a))/((b-a)(c-a))),{x,a,c}]+Integrate[((2(b-x))/((b-a)(b-c))),{x,c,x}]-1]

{((2(x-a))/((b-a)(c-a))),((2(b-x))/((b-a)(b-c)))}/.x->c

{((((a-x))^2)/((a-b) (a-c))) ,1+((((b-x))^2)/((a-b) (b-c)))}/.x->c//Simplify

FullSimplify[Integrate[PDF[TriangularDistribution[a,b,c],t],{t,a,x},Assumptions->a≤c≤b&&x≤b],a≤c≤b&&x≤b]

v6

CDF[TriangularDistribution[a,b,c],x]

Normalization

FullSimplify[Integrate[PDF[TriangularDistribution[a,b,c],x],{x,a,b},Assumptions->a≤c≤b],a≤c≤b]

Raw Moments

FullSimplify[Integrate[x^n PDF[TriangularDistribution[a,b,c],x],{x,a,b},Assumptions->a≤c≤b],a≤c≤b]

Table[FullSimplify[Integrate[x^n((2(x-a))/((b-a)(c-a))),{x,a,c}]+Integrate[x^n((2(b-x))/((b-a)(b-c))),{x,c,b}]],{n,0,4}]//ColumnForm//TraditionalForm

Expand[((a^3)+(a^2) (b+c)+(b+c) ((b^2)+(c^2))+a ((b^2)+b c+(c^2)))]

Mean

v6

Mean[TriangularDistribution[a,b,c]]

Central Moments

Table[Factor[Integrate[(x-μ)^n((2(x-a))/((b-a)(c-a))),{x,a,c}]+Integrate[(x-μ)^n((2(b-x))/((b-a)(b-c))),{x,c,b}]/.μ->(a+b+c)/3],{n,0,4}]//ColumnForm//TraditionalForm

Variance

v5.0

Integrate[PDF[TriangularDistribution[a,b,c],x](x-Mean[TriangularDistribution[a,b,c]])^2,{x,a,b},Assumptions->a<c<b]

Integrate[PDF[TriangularDistribution[a,b,c],x](x-Mean[TriangularDistribution[a,b,c]])^2,{x,a,c},Assumptions->a<c<b]+Integrate[PDF[TriangularDistribution[a,b,c],x](x-Mean[TriangularDistribution[a,b,c]])^2,{x,c,b},Assumptions->a<c<b]

v5.1

Integrate[PDF[TriangularDistribution[a,b,c],x](x-μ)^2,{x,a,b},Assumptions->a<c<b]/.μ->Mean[TriangularDistribution[a,b,c]]//Factor

Integrate[PDF[TriangularDistribution[a,b,c],x](x-Mean[TriangularDistribution[a,b,c]])^2,{x,a,c},Assumptions->a<c<b]+Integrate[PDF[TriangularDistribution[a,b,c],x](x-Mean[TriangularDistribution[a,b,c]])^2,{x,c,b},Assumptions->a<c<b]//Factor

v6

Variance[TriangularDistribution[a,b,c]]

Skewness

v5.1

(1/((Subscript[μ, 2])^(3/2)))Integrate[PDF[TriangularDistribution[a,b,c],x](x-μ)^3,{x,a,b},Assumptions->a<c<b]/.{μ->Mean[TriangularDistribution[a,b,c]],(Subscript[μ, 2])->Variance[TriangularDistribution[a,b,c]]}//Factor

Simplify[With[{f=2(c-a)/(b-a)-1},Subtract@@{(((Sqrt[2]) (a+b-2 c) (2 a-b-c) (a-2 b+c))/(5 ((((a^2)-a b+(b^2)-a c-b c+(c^2)))^(3/2)))),2((Sqrt[2])/5)f(((f^2-9))/((((f^2)+3))^(3/2)))}
],a<c<b]

Kurtosis Excess

v5.1

((1/((Subscript[μ, 2])^2))Integrate[PDF[TriangularDistribution[a,b,c],x](x-μ)^4,{x,a,b},Assumptions->a<c<b]/.{μ->Mean[TriangularDistribution[a,b,c]],(Subscript[μ, 2])->Variance[TriangularDistribution[a,b,c]]})-3//Factor