• No results found

Poisson and compound Poisson models

2.2 Models for count data

2.2.1 Poisson and compound Poisson models

A Poisson distributed variable is a random variable with a range on the natural num-bers characterized by a positive continuous rate. It is the prototypical distribution for modeling counts, utilized usually in situations where the probability of a count event happening is constant over time or space. It can be seen as an approximation for the Binomial distribution as the numbernof trials increases – also known as the law of rare events(Shiryaev and Boas, 1995). If we imagine an interval divided into nequally spaced sub-intervals, where events can ocurr at each sub-interval with the same probability λn, and at each interval there is an independent success/fail Bernoulli trial Ber(λn) adding a count of at most 1, the total counts of events will have a Binomial distribution Bin(n,λn). Thelaw of rare events estabilish that as the number of sub-intervalsnincreases, therefore decreasing the probability of a single event at each sub-interval, the Binomial distributed total count of events will converge to the Poisson distribution with rateλ, that we can express with the equation limn→∞Bin(n,λn) = Poisson(λ). Furthermore, the Poisson distribution achieves good approximation rates for sum ofnindependent Bernoulli variables, expressed in terms of the KL divergence with an order of O(n−2) (Bobkov et al., 2019).

Thus, in many real world scenarios with count data the Poisson distribution is a good initial fit, given that it can capture or approximate the total counts in situations with large number of events, with count increments happening with small (equal or similar) probabilities, under the condition that the sum of those probabilities converges to the rate of the associated Poisson distribution. In Definition 2.2 the probability mass function, the expected value and variance of the Poisson distribution is formally presented.

Definition 2.2 (Poisson distribution). A Poisson distributed random variable XPoisson(λ) has its support on the setN0 = {0} ∪N and as parameter the positive continuous rateλ >0. The probability mass function is given by

P(X=x) =P oisson(x;λ) =λxe−λ

x! (2.12)

The expected value and variance are given by

E[X;λ] =V[X;λ] =λ (2.13)

It is possible to increase the flexibility of a Poisson model by adding a prior to the rate parameter. The support of the prior distribution should be the positive real lineR+, and if we impose the restriction of a conjugate prior, we conclude that it should be a Gamma distribution. We formally define the Gamma distribution in Definition 2.3.

Definition 2.3 (Gamma distribution). A Gamma distributed random variable λGamma(a, b)has its support on the positive real lineR+ and parameters shape a >0 and rate b >0. The probability density function is given by9

Gamma(λ;a, b) = ba

Γ(a)λa−1e−bλ (2.14) The expected value and variance are given by

E[λ;a, b] = a

b (2.15)

V[λ;a, b] = a

b2 (2.16)

A conjugacy analysis of the Poisson-Gamma model can be performed by assum-ing a model for a set ofnPoisson distributed observations and a Gamma latent rate, p(x, λ) = Gamma(λ;a, b)Qn

i=1Poisson(xi|λ), and computing the posterior distri-bution of the rate given the observationsp(λ|X). Applying the Bayes’ Theorem and focusing on the terms that are related toλwe obtain

p(λ|X) = 1

We can also compute the marginal expected value and variance of the observa-tions using the law of total expectation and variance obtainingE[Xi] =E[E[Xi|λ]] =

a

b andV[Xi] =E[V[Xi|λ]] +V[E[Xi|λ]]] =ab +ba2. By inspection of those formula we can observe that the resulting marginal distribution of the observations of our model is overdispersed – defined in terms of variance to mean ratio bigger than one (Hilbe, 2014). A similar analysis can be carried by marginalization of the rate λin joint of the model, which results in a marginal Negative-Binomial distribution

9The function Γ is defined as Γ(t) =R

0 xt−1e−xdxand have the property Γ(t+ 1) =tΓ(t)

NB(a,b+1b ) with the same mean and variance calculated previously (Hilbe, 2014).

This result can be generalized to any hierarchical Poisson model with a prior rate distribution parameterized by meanµand varianceσ2, resulting in marginal mean E[Xi] =µand varianceV[Xi] =µ+σ2, in other words an additive relationship between mean and varianceV[Xi] =E[Xi] +σ2. This approach of adding flexibility to the distribution via latent variables of the Poisson will be useful in our models, given that it allows for more complex models while also being used for coupling different observations, in the case of shared latent variables.

There are many properties of interest of Poisson models for the development of more complex count models. Theadditivityproperty is the fact that we can combine a set of Poisson models via summation into a single Poisson model with the rate given by the sum of rates of each individual model. Thedecompositionproperty, also known as Raikov’s theorem (Raikov, 1938), states the converse, that if a Poisson random variable admits a decomposition as a sum of independent random variables, then each summand is Poisson distributed. In hierarchical models we can use these properties to justify the use oflatent countsfor a given Poisson model, which can be useful to simplify certain models as well as provide explanatory power, since we can interpret individually summand terms of complex models as generating counts. For example ifY ∼Poisson(PK

k=1λk), we can create an equivalent modelY =PK k=1Zk

with latent countsZk∼Poisson(λk), fork∈[K]. The use of latent counts leads to another interpretation of Poisson-Gamma models as anallocative model (Schein, 2019; Yildirim et al., 2021), meaning that the latent rates define probabilities of allocation of counts or events in different buckets, given a total number of counts summing all buckets. This can be formalized when calculating the conditional distribution of latent countsZ1, . . . , ZK given the observed total countsY, which follows a Multinomial distributionp(Z1, . . . , ZK|Y) = Mult(Z1, . . . , ZK;Y,p) with the probabilities proportional to the rates of each individual count. Thus, the total count Y represent abudget of counts that can be allocated to each individual latent countZk with a probability proportional to the rate of that individual count pk = λλk. The allocative intuition of the latent counts can be used as well when thinking about latent variable models, in particular it helps one intuit about the role that different terms might be playing in your model. For example, if we assume a model with a rateλ>η=PK

k=1θkηk, whereθ andηare high-dimensional non-negative vectors, latent counts will be allocated to each latent dimension with a probability pk = θθk>ηηk, allowing us to interpret the value of each component of the latent vector as the strength of this allocation. To formalize these, we present the Multinomial distribution in Definition 2.4 and the aforementioned properties in the Proposition 2.1 and Proposition 2.2.

Definition 2.4(Multinomial distribution). The random vectorz∼Mult(n,p)is a

K dimensional count vectorz:= [z1, . . . , zK]∈NK0 sampled from the Multinomial distribution defined by the parameters totals count n∈Nand event probabilities vector p := [p1. . . , pK] ∈ [0,1]K, with PK

k=1pk = 1 and PK

k=1zk = n. The probability mass function is given by

Mult(z;n,p) =n!

The expected value and variance for each individual count variable is

E[zk;n,p] =npk (2.17)

V[zk;n,p] =npk(1−pk) (2.18) Proposition 2.1 (additivity and decomposition). Given a set of K Poisson distributed random variables and rates ZkPoisson(λk), the random variable Y :=PK

k=1Zk is Poisson distributed as YPoisson(λ:=PK

k=1λk). The con-verse is also true, meaning that if we can decomposeY =PK

k=1ZkPoisson(λ) into individual separate counts, each summandZk will be Poisson distributed with ratesλk that should sum to λ.

Proof. Raikov (1938)

Proposition 2.2. Given a set of K Poisson distributed random variables and ratesZkPoisson(λk)and the random variableY :=PK

k=1ZkPoisson(λ), with λ=PK

k=1λk, the conditional distribution of the random vectorz:= [Z1, . . . , ZK] given the their sumY is

z|Y ∼Mult(Y,p) Proof. The joint probability can be written as

K

and conditioning on the sum with the probability given byλn e−λn! and reorga-nizing the terms we obtain

Furthermore, we can define complex models using Poisson counts as latent variables, while choosing other distributions for the observations. The family of compound Poisson models consists of a Poisson distributed latent count N ∼ Poisson(λ) and a sumY =PN

i=1XioverN independent random variables from a fixed distributionG, withXiG. If we assume a meanE[Xi] =µG and variance V[Xi] =σ2G, we can apply iterated formulas for mean and variance to obtain the marginal meanE[Y] =E[N µg] =λµG and varianceV[Y] =E[N σG2] +V[N µg] = λ(µ2G+σ2G), which indicates over-dispersion, but with an additive and multiplicative terms relating the mean and variance, namely V[Y] = E[Y]µG+λσ2G. In the context of Poisson matrix factorization models (Basbug and Engelhardt, 2016;

Simsekli et al., 2013; Gouvert et al., 2019), one family of models that has been incorporated in the compound Poisson model is the exponential dispersion model (EDM) (Jorgensen, 1987) family. This model family includes Normal, Poisson, Gamma, Inverse-Gamma, and many other discrete and continous distributions (see Table 1 in Basbug and Engelhardt (2016) and Table 1 in Gouvert et al. (2019)).

The EDM family also has the additivity property, which is convenient when building compound Poisson models, allowing the latent Poisson counts to be incorporated in the parameters of the EDM model, formally ifN ∼Poisson(λ) andY =PN

n=1Zn, withZn∼ED(w, κ), thenY ∼ED(w, N κ).

Definition 2.5(exponential dispersion model). The random variableYED(w, κ) is sampled from an exponential dispersion model distribution, with natural parameter w, dispersion parameter κ >0, log-partition ψ(w)and base measureh(Y, κ). The probability density function is given by10

p(Y) =ED(Y;w, κ) =exp(Y wκψ(w))h(Y, κ) The expected value and variance is given by11

E[Yij;w, κ] =κψ0(w) (2.19) V[Yij;w, κ] =κψ00(w) (2.20) Proposition 2.3 (additivity). Given a set of EDM distributed random variables ZnED(w, κ), with n∈ Nand nN, the random variable Y :=PN

n=1Zn is EDM distributed as YED(w, N κ).

Proof. Jorgensen (1987)

10The dependency on the log-partition functionψand base measure functionhis left implicit, since it is defined for each specific distribution that is part of the EDM family.

11We denoteψ0(w) =

dw,ψ00(w) = d2ψ

dw2

In this section we presented the main properties of Poisson and compound Poisson models that are of interest in the development of the models used in this thesis. We establish definitions and properties that will be used in development of new models, in the case of Poisson models, and the analysis of those models, in the case of compound Poisson models. For a broader treatment of the topic of models for count data, covering different distributions, over-dispersion, zero-inflation and many other topics, the reader can consult the reference works of Hilbe (2014) and Zelterman (2004).