MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Skellam distribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102208] Re: [mg102152] Skellam distribution
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 1 Aug 2009 04:01:11 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Clear[SkellamDistribution];

SkellamDistribution::usage = 
  "SkellamDistribution[a1,a2] is the Skellam discrete probability \
distribution with parameters a1 and a2. \
http://en.wikipedia.org/wiki/Skellam_distribution";;

SkellamDistribution /: PDF[
   SkellamDistribution[a1_, a2_], k_] :=
  
  Exp[-(a1 + a2)]*(a1/a2)^(k/2)*
   BesselI[k, 2 Sqrt[a1*a2]];

SkellamDistribution /: mgf[
   SkellamDistribution[a1_, a2_], t_] :=
  
  Exp[-(a1 + a2) + a1*Exp[t] + a2*Exp[-t]];

SkellamDistribution /: CharacteristicFunction[
   SkellamDistribution[a1_, a2_], t_] :=
  
  Exp[-(a1 + a2) + a1*Exp[I*t] + a2*Exp[-I*t]];

SkellamDistribution /: Moment[
   SkellamDistribution[a1_, a2_], n_Integer] :=
  Module[{t},
   D[mgf[SkellamDistribution[a1, a2], t], {t, n}] /.
    t -> 0];

SkellamDistribution /: CDF[
   SkellamDistribution[a1_, a2_], k_] :=
  Sum[PDF[
    SkellamDistribution[a1, a2], x],
   {x, -Infinity, k}];

SkellamDistribution /: Mean[
   SkellamDistribution[a1_, a2_]] :=
  (a1 - a2);

SkellamDistribution /: Variance[
   SkellamDistribution[a1_, a2_]] :=
  (a1 + a2);

SkellamDistribution /: StandardDeviation[
   SkellamDistribution[a1_, a2_]] :=
  Sqrt[a1 + a2];

Table[{n,
  Moment[SkellamDistribution[a1, a2], n]},
 {n, 0, 2}]

{{0, 1}, {1, a1 - a2}, {2, (a1 - a2)^2 + a1 + a2}}


Bob Hanlon

---- Peter Breitfeld <phbrf at t-online.de> wrote: 

=============

Is there an implementation of the Skellam distribution? If not, how
would you implement a CDF for this distribution?

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de




  • Prev by Date: Re: Help with concatenating a list with &&
  • Next by Date: Re: Skellam distribution
  • Previous by thread: Re: Skellam distribution
  • Next by thread: Re: Skellam distribution