von Mises Distribution

Author

Eric W. Weisstein
October 21, 2004

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

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

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

Code

VonMisesDistribution/:PDF[VonMisesDistribution[a_,b_],x_]:=((Exp[b Cos[x-a]])/(2π BesselI[0,b]))
VonMisesDistribution/:CDF[VonMisesDistribution[a_,b_],x_]:=(∫_0^x)((E^(b Cos[y-a]))/(2 π BesselI[0,b]))\[DifferentialD]y
VonMisesDistribution /:Domain[VonMisesDistribution[a_,b_]]:=Interval[{0,2Pi}]

CDF1[VonMisesDistribution[{a_,b_}],x_]:=(x BesselI[0,b]+2 Sum[BesselI[j,b]Sin[j(x-a)]/j,{j,0,∞}])/(2π BesselI[0,b])

Plot

PDF[vonMises]=PDF[VonMisesDistribution[#]]&/{{0,1},{1,2},{3,2}};
CDF[vonMises]=CDF[VonMisesDistribution[#]]&/{{0,1},{1,2},{3,2}};

<<Graphics`Colors`

ticks={Transpose[{Range[0,2π,π/2],{0,"π/2",π,"3π/2",2π}}],Automatic};

Show[GraphicsArray[
Plot[Evaluate[#[vonMises]],
{x,0,2π},DisplayFunction->Identity,AxesLabel->TraditionalForm/@{x,#[x]},Ticks->ticks,PlotStyle->List/@{Black,Red,Blue}]&/@{PDF,CDF}],ImageSize->500]//Timing

Moments

Normalization

Integrate[PDF[VonMisesDistribution[a,b],x],{x,0,2π}]

Table[With[{a=Random[Real,{0,2π},20],b=Random[Real,{0,10},20]},
NIntegrate[PDF[VonMisesDistribution[a,b],x],{x,0,2π}]],{10}]//Union

Mean

Integrate[x PDF[VonMisesDistribution[a,b],x],{x,0,2π}]

Table[With[{a=Random[Real,{0,2π},20],b=Random[Real,{0,10},20]},
{a,b,NIntegrate[x PDF[VonMisesDistribution[a,b],x],{x,0,2π},WorkingPrecision->20]}
],{10}]//Union

Check

d[x_,{a_,b_}]:=NIntegrate[((E^(b Cos[y-a]))/(2 π BesselI[0,b])),{y,0,x}]

(d1[x,{0,1}]-d[x,{0,1}] /. x->#)&/@{0.,.2,.5,1.,2.}

Normalization and Distribution Function

PDF

Numerical

Table[NIntegrate[PDF[VonMisesDistribution[{a,b}],x]/.{a->Random[Real,{0,10},30],b->Random[Real,{0,10},30]},{x,0,2π},WorkingPrecision->30],{20}]//Union//Timing

v5.0.1

Integrate[PDF[VonMisesDistribution[{a,b}],x],{x,0,2π}]//Timing

Integrate[PDF[VonMisesDistribution[{a,b}],x],x]

Integrate[PDF[VonMisesDistribution[{0,b}],x],{x,0,2π},Assumptions->b>0]

...wrong...

Table[1-((StruveL[0,b])/(BesselI[0,b]))/.b->Random[Real,{0,5}],{20}]

v5.1

Integrate[PDF[VonMisesDistribution[{a,b}],x],{x,0,2π},Assumptions->b>0]//Timing

Integrate[PDF[VonMisesDistribution[{0,b}],x],{x,0,2π}]//Timing

Integrate[PDF[VonMisesDistribution[{0,b}],x],{x,0,2π},Assumptions->b>0]//Timing

v6.0

Integrate[PDF[VonMisesDistribution[{a,b}],x],{x,0,2π}]//Timing

Integrate[PDF[VonMisesDistribution[{0,b}],x],{x,0,2π}]//Timing

Integrate[PDF[VonMisesDistribution[{0,b}],x],{x,0,2π},Assumptions->b>0]//Timing

CDF

Integrate[PDF[VonMisesDistribution[{a,b}],x],{x,0,x},Assumptions ->0<a<b]

Integrate[PDF[VonMisesDistribution[{0,b}],x],{x,0,x},Assumptions -> b>0]

Sum[BesselI[j,b]Sin[j(x-a)]/j,{j,∞}]

(1/(2π BesselI[0,b]))(x I

Raw Moments

FullSimplify[Integrate[p[x,{0,1}],{x,0,2π}]]

Table[Simplify[Integrate[x^n p[x,{a,b}],{x,0,2π}]],{n,0,2}]

Table[Simplify[Integrate[x^n p[x,{0,b}],{x,0,2π}]],{n,0,2}]