({{, (RefLink[CompoundPoissonDistribution, paclet:ref/CompoundPoissonDistribution])[λ,dist] 
represents a compound Poisson distribution with rate parameter λ and jump size distribution dist.}})

OpenersNotesSection(Spacer1)Details

(RefLink[CompoundPoissonDistribution, paclet:ref/CompoundPoissonDistribution]) is also known as a stopped-sum distribution.

The compound Poisson distribution is equivalent to (∑_(i=1)^n)(Subscript[x, i]), where (Subscript[x, i]) are independent and identically distributed random variables following dist and n\[Distributed](RefLink[PoissonDistribution, paclet:ref/PoissonDistribution])[λ].

(RefLink[CompoundPoissonProcess, paclet:ref/CompoundPoissonProcess]) allows λ to be any positive real number and dist to be any univariate distribution.

(RefLink[CompoundPoissonDistribution, paclet:ref/CompoundPoissonDistribution]) can be used with such functions as (RefLink[Mean, paclet:ref/Mean]), (RefLink[Variance, paclet:ref/Variance]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (18)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Define a compound Poisson distribution:

𝒟=CompoundPoissonDistribution[λ,PascalDistribution[n,p]];

Mean and variance:

{Mean[𝒟],Variance[𝒟]}//Simplify

Simulate a compound Poisson distribution:

data=RandomVariate[CompoundPoissonDistribution[4.4,ExponentialDistribution[2]],10^4];

Histogram[data,30,"PDF"]

OpenersExampleSection1(Spacer1)Scope  (7)

Simulate a compound Poisson distribution for different renewal rates:

data=Table[RandomVariate[CompoundPoissonDistribution[λ,WeibullDistribution[2,3]],10^4],{λ,{1,4,10}}];

Histogram[data,30,"PDF"]

Distribution parameter estimation:

data=RandomVariate[CompoundPoissonDistribution[4.4,ExponentialDistribution[2]],10^3];

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[data,CompoundPoissonDistribution[λ,ExponentialDistribution[m]],ParameterEstimator->"MethodOfMoments"]

Compare the histogram of the data with a sample from the estimated distribution:

Show[Histogram[{data,RandomVariate[edist,10^3]},30,"PDF"]]

Define a compound Poisson distribution:

𝒟=CompoundPoissonDistribution[λ,GammaDistribution[a,b]];

Skewness:

Skewness[𝒟]//Simplify

Kurtosis:

Kurtosis[𝒟]

Define a compound Poisson distribution:

𝒟=CompoundPoissonDistribution[λ,rdist=NormalDistribution[μ,σ]];

Calculate cumulants:

Table[Cumulant[𝒟,r],{r,0,5}]

Compare to the reward distribution:

Table[Cumulant[rdist,r],{r,0,5}]

Compare to the renewal distribution:

Table[Cumulant[PoissonDistribution[λ],r],{r,0,5}]

Different moments with closed forms as functions of parameters:

𝒟=CompoundPoissonDistribution[λ,BernoulliDistribution[p]];

FormulaGrid[list_,type_]:=Grid[Transpose[{list}],Alignment->{Left,Automatic},Background->{None,{{Lighter[Blend[Switch[type,M,{Blue,Green},CM,{Red,Orange},FM,{Magenta,Cyan},C,{Purple,Red}]],.8],White}}},Dividers->{None,{Darker[Gray,.6],{False},Darker[Gray,.6]}},ItemSize->30]

(RefLink[Moment, paclet:ref/Moment]):

FormulaGrid[Table[Moment[𝒟,k],{k,5}],M]

(RefLink[CentralMoment, paclet:ref/CentralMoment]):

FormulaGrid[Table[CentralMoment[𝒟,k],{k,5}],CM]

(RefLink[FactorialMoment, paclet:ref/FactorialMoment]):

FormulaGrid[Table[FactorialMoment[𝒟,k],{k,5}],FM]

(RefLink[Cumulant, paclet:ref/Cumulant]):

FormulaGrid[Table[Cumulant[𝒟,k],{k,5}],C]

Generating functions for a (RefLink[CompoundPoissonDistribution, paclet:ref/CompoundPoissonDistribution]):

𝒟=CompoundPoissonDistribution[3,NormalDistribution[]];

Characteristic function:

CharacteristicFunction[𝒟,t]

Moment generating function:

MomentGeneratingFunction[𝒟,t]

Factorial moment generating function:

FactorialMomentGeneratingFunction[𝒟,t]

Cumulant generating function:

CumulantGeneratingFunction[𝒟,t]

Compound Poisson distribution with a mixture jump distribution:

𝒟 = CompoundPoissonDistribution[25, MixtureDistribution[{10, 15}, 
     {ExponentialDistribution[1], GammaDistribution[2, 1]}]];

Mean of the distribution:

Mean[𝒟]

Compare with the value obtained from simulation:

Mean[RandomVariate[𝒟,10^4]]

OpenersExampleSection3(Spacer1)Applications  (2)

Shoppers arrive at a newly renovated store according to a Poisson process with a rate of 20 customers per hour. The store promotes this event by giving every customer a gift. The gift has a value that follows a Weibull distribution with shape parameter 10 and scale parameter 3. Find the expected total cost of the gifts given by the store during the 12-hour period for which the store is open on that day:

giftDistribution=CompoundPoissonDistribution[20*12,WeibullDistribution[10,3]];

Expected total cost of the gifts given on the inaugural day:

Mean[giftDistribution]//N

Probability that the store spends between $500 and $800 on the gifts:

gifts=RandomVariate[giftDistribution,10^4];

Histogram[gifts,{400,900,25},"PDF"]

Probability[500<p<800,p\[Distributed]gifts]//N

Aggregate claims from a risk have a compound Poisson distribution with Poisson parameter 200 and an individual claim amount distribution, which is a Pareto distribution with minimum value parameter 300, shape parameter 3, and location parameter 0. The insurer has effected excess of loss reinsurance with retention level $300. Calculate the mean and variance of the reinsurer's aggregate claims. The individual claims for the reinsurer follow a transformed Pareto distribution, since the reinsurer only pays amounts greater than $300:

individualClaimDistribution=TransformedDistribution[Max[0,x-300],x\[Distributed]ParetoDistribution[300,3,0]];

The aggregate claims:

aggregateClaimDistribution=CompoundPoissonDistribution[200,individualClaimDistribution];

Histogram[RandomVariate[aggregateClaimDistribution,10^4],{0,20000,1000},"PDF"]

Mean and variance of the reinsurer's aggregate claims:

{Mean[aggregateClaimDistribution],Variance[aggregateClaimDistribution]}

OpenersExampleSection4(Spacer1)Properties & Relations  (6)

Renewal rate influences the kurtosis:

𝒟[λ_]=CompoundPoissonDistribution[λ,NormalDistribution[]];

data = Table[RandomVariate[𝒟[λ],10^3],{λ,{1,3,9}}];

Histogram[#,20,"PDF"]&/@data

Kurtosis/@data

Use a different reward distribution:

𝒹[λ_]=CompoundPoissonDistribution[λ,ExponentialDistribution[3]];

sample = Table[RandomVariate[𝒹[λ],10^3],{λ,{1,3,9}}];

Histogram[#,20,"PDF"]&/@sample

Kurtosis/@sample

(RefLink[CompoundPoissonDistribution, paclet:ref/CompoundPoissonDistribution]) is a slice distribution of (RefLink[CompoundPoissonProcess, paclet:ref/CompoundPoissonProcess]):

CompoundPoissonProcess[λ,WeibullDistribution[a,b]][t]

Slice of (RefLink[CompoundRenewalProcess, paclet:ref/CompoundRenewalProcess]) with renewal time given by (RefLink[ExponentialDistribution, paclet:ref/ExponentialDistribution]):

dist[λ_,t_]:=CompoundRenewalProcess[ExponentialDistribution[λ],NormalDistribution[]][t];

Create a random sample for rate 3 and slice at 7:

SeedRandom[4728];
sample1=RandomVariate[dist[3,7],10^4];

Histogram[sample1,30,"PDF"]

Compare to a sample of the corresponding (RefLink[CompoundPoissonDistribution, paclet:ref/CompoundPoissonDistribution]):

SeedRandom[4728];
sample2=RandomVariate[CompoundPoissonDistribution[3*7,NormalDistribution[]],10^4];

Histogram[{sample1,sample2},30,"PDF"]

CPD with (RefLink[NormalDistribution, paclet:ref/NormalDistribution]) as a reward distribution is again a normal distribution:

dist[μ_,σ_]:=NormalDistribution[μ,σ]

sample=RandomVariate[CompoundPoissonDistribution[4,dist[0,1]],10^3];

Compare to the PDF of the sum of n normal variates where n is the mean of the Poisson distribution:

Show[Histogram[sample,30,"PDF"],Plot[PDF[dist[0,Sqrt[4*1]],x],{x,-6,6},PlotStyle->Thick]]

CPD with (RefLink[BernoulliDistribution, paclet:ref/BernoulliDistribution]) follows a (RefLink[BinomialDistribution, paclet:ref/BinomialDistribution]):

dist[p_]:=BernoulliDistribution[p]

sample=RandomVariate[CompoundPoissonProcess[1,dist[.3]][100],10^3];

Compare to the (RefLink[PDF, paclet:ref/PDF]) of the sum of n Bernoulli variates where n is the mean of the Poisson distribution:

Show[Histogram[sample,30,"PDF"],DiscretePlot[PDF[BinomialDistribution[100*1,.3],x],{x,0,50},PlotStyle->PointSize[Medium]]]

CPD with a (RefLink[LogSeriesDistribution, paclet:ref/LogSeriesDistribution]) follows a (RefLink[NegativeBinomialDistribution, paclet:ref/NegativeBinomialDistribution]):

cP=CompoundPoissonDistribution[μ,LogSeriesDistribution[θ]];

The parameters of the (RefLink[NegativeBinomialDistribution, paclet:ref/NegativeBinomialDistribution]) are given by:

p=((θ ProductLog[(((((1-θ))^(1/θ)) Log[1-θ])/θ)])/(Log[1-θ]));

n=-(μ/(Log[θ]-Log[Log[1-θ]]+Log[ProductLog[(((((1-θ))^(1/θ)) Log[1-θ])/θ)]]));

𝒟=NegativeBinomialDistribution[n,p];

Plot the probability density functions:

Block[{μ=3,θ=1/7},DiscretePlot[#,{x,0,10},ExtentSize->1/2]&/@{PDF[cP,x],PDF[𝒟,x]}]

OpenersExampleSection5(Spacer1)Possible Issues  (1)

The default parameter estimation using maximum likelihood might take a long time:

data=RandomVariate[CompoundPoissonDistribution[4.4,GammaDistribution[4,2]],10^3];

TimeConstrained[EstimatedDistribution[data,CompoundPoissonDistribution[λ,GammaDistribution[a,m]]],10,$TimedOut]

Use a different method:

EstimatedDistribution[data,CompoundPoissonDistribution[λ,GammaDistribution[a,m]],ParameterEstimator->"MethodOfMoments"]//AbsoluteTiming

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[PoissonDistribution, paclet:ref/PoissonDistribution])  ▪  (RefLink[TransformedDistribution, paclet:ref/TransformedDistribution])  ▪  (RefLink[CompoundPoissonProcess, paclet:ref/CompoundPoissonProcess])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Actuarial Computation, paclet:guide/ActuarialComputation])}, {▪(RefLinkPlain[Derived Statistical Distributions, paclet:guide/DerivedDistributions])}})}})