Posts tagged with poisson

1 comments

The truncated Poisson

A common model for counts data is the Poisson. There are cases however that we only record positive counts, ie there is a truncation of 0. This is the truncated Poisson model.

To study this model we only need the total counts and the sample size. This comes from the sufficient statistic principle as the likelihood is

$$ logL=-n-\frac{e^{-\lambda } n}{1-e^{-\lambda }}+\frac{T}{\lambda }$$,

where $$ T=\sum _X$$. Let’s set $$ T=160$$ and  $$ n=50$$.

sum.x=160
n=50
library(maxLik)

loglik <- function(theta, n, sum.x) {
- n* log(exp(theta) - 1) + sum.x * log(theta)
}

The gradient is

$$ \frac{e^{-2 \lambda } n}{\left(1-e^{-\lambda }\right)^2}+\frac{e^{-\lambda } n}{1-e^{-\lambda }}-\frac{T}{\lambda ^2}$$.

Read the rest of this entry »

Studying the distributional properties of the maximum is gaining more of attention nowadays given the relative failure of the conventional tools the quants used before the recession.

Let’s suppose that an insurance company faces the challenge to cover claims incurring in random time and size. The intensity of the process is $latex \lambda (t)=100t(1-t)$, $latex \lambda (0)=25$ and the process itself is (surprise!!!) Poisson. The claims are iid from a lognormal distribution with parameters $latex \mu=0.75t$ and $latex \sigma=1$, where $latex t$ is the intermediate time between occurence $latex i$ and $latex i-1$.

Some Mathematica code from my Graduate Simulation class is the following.

First we set up the intersity function and the generic vectors recoring Claims (Claimsv) and maximums (Maxv)

λ0 = 25; t0 = 1;
λ[t_] := 100 (t – t^2); Claimsv = {}; Maxv = {};

The main program is the following

Do[S = {}; t = 0; n = 0;
X = -Log[Random[]]/λ0; t = t + X;
While[t < t0, If[Random[] < λ[t]/λ0, n = n + 1; S = Append[S, t]];
X = -Log[Random[]]/λ0; t = t + X];
Claims = 0; S[[0]] = 0; Maxx = 0; Do[rr = Exp[
Random[NormalDistribution[0.75*(S[[i]] – S[[i - 1]]), 1]]];
If[rr > Maxx, Maxx = rr];
Claims = Claims + rr, {i, 1, n}] AppendTo[Claimsv, Claims];
AppendTo[Maxv, Maxx];, {10000}]

And plotting the histograms of the simulated distribution of the Claims and the maximum we nearly finished…

<< Histograms`

Histogram[Claims.v]
claimsv Histogram[Max.v]

maxv

to be continued…

Detecting reliably an event is surely something to worry about in applied science. One of the main models used is the perfect-imperfect detector, obviously underlying a Poisson process…  Two detectors are counting events generated by a source (eg a photon device). The first one detects efficiently (perfect) the events whether the other one lacks efficiency.

Then X~Poi(λ) and Y~Poi(λp), where p is the inefficiency ratio and estimation is (almost) trivial. Assume that m,r are the counts of X,Y respectively. Furthermore, let k be the total observations and n the observations of X.

The mle of λ is m/n as usual. What about p?

The likelihood is proportional to $latex exp \left[ -\lambda p\left( k-n \right) \right]{{\left( \lambda p \right)}^{r}}$, so taking logarithms and differentiating with respect to p gives us that the mle is $latex \hat{p}=\frac{mr}{n(k-n)} $.

The real question is : what if $latex \frac{mr}{n(k-n)}>1$?

Look it up… S. S. Chitgopekar, “A note on the estimation of the Poisson parameter,” International Journal of Mathematics and Mathematical Sciences, vol. 8, no. 1, pp. 193-196, 1985. [pdf]

Real Time Web Analytics