# How to model a random variable with a peak, and quantify the effect of external event - Bayesian Analysis

I have a (integer) random variable that looks like this : So as you can see, has a regular behaviour for most of the time, but at some point a peak appears, and after a while this effect disappear and the variable goes down to his regular behaviour.

My question is how can I model this, using Bayesian Analysis tools like PYMC3 ?

So far I tried to describe de model like this:

Before some point $\tau1$ , the variable follows a Poisson distribution with some $\lambda1$. for a period of time $\tau2$ the variable is the sum of two Poisson distribution, characterized with $\lambda1$ and $\lambda2$ . $\lambda2$ is the "effect" of the external event that modify the variable. Then after a time $\tau1 + \tau2$ the variable goes down to the regular behaviour with $\lambda1$

From this model I want to know the values of $\tau1$ and $\tau2$ . And by fitting this model with the MCMC method it does converge to certain values. The point $\tau1$ is found by the model almost perfectly ( it corresponds to a know event ) but the duration of this effect ( and that is the thing of my interest ) does not seems to have much sense, as the model give it a value ( the mean of samples for $\tau2$ ) of 2 , but if you take a closer look it seem to last longer, something like six minutes.

So, there is a better way to model this kind of events, to quantify the duration of that external event ?