# Fit to a non-homogeneous Poisson process

I have a sequence of event timings, $t_1, t_2, t_3, ..., t_n$ where there are a total number of $n$ events happening. For example, they are the timings when 911 was called in a city.

I know these events is a non-homogeneous (or inhomogeneous) Poisson process, where $\lambda=\lambda(t)$ where $\lambda$ is a function of time $t$. For example, when a riot is on, the $\lambda$ will surge up for a while, and then gradually decay to its normal frequency, as the effect of the riot fade away.

I have a model for this process, where given parameters $x$, I can generate a curve for $\lambda(t)$. Now the task is: fit the curve to actual data in order to obtain $x$. So here is what I did, which did not work:

1) I generated instantaneous event rate, by getting inter-event intervals and taking the inverse;

2) Use the least-square fit, where I minimize the squared sum of error between the generated $\lambda(t)$ curve and the actual instantaneous event rate data.

Well - there is a reason that this won't work: the least-square method is assuming normal distribution of error. When $\lambda$ is small, the Poisson distribution is obviously asymmetric, and hence cannot be fitted nicely with least squares method.

Given that - what should I do?

Assume you want to model the intensity $$\lambda$$ by some $$\lambda_\theta$$ where $$\theta$$ is a parameter. For a temporal Poisson point process on the interval $$[0,T]$$ the log-likelihood is known and given by $$l(t_1, \ldots, t_n) = - \int_{0}^{T} \lambda (u) \, \mathrm{d} u + \sum_{i=1}^n \log \lambda(t_i)$$ where $$t_i$$ are the event times. You can then perform maximum likelihood estimation: Substitute the $$\lambda$$ by your model $$\lambda_\theta$$ and find a $$\theta$$ which maximizes the resulting expression.