# Probability of periodically happening event occurring at a given time based on previous data

Assume that an event $X$ happens periodically over time with a period $P_X$. When it starts it lasts for a time $T_X$. $P_X$ and $T_X$ may vary slightly. There is no correlation between $P_X$ and $T_X$. For example:

1. Event $X$ starts and lasts for 7 days.
2. 20 days of nothing
3. Event $X$ starts and lasts for 5 days.
4. 22 days of nothingt
5. Event $X$ starts and lasts for 6 days.
6. 19 days of nothing
7. etc.

I have a data set over previous time and now I want to be able to predict the probability, as well as the confidence level, of the event occurring e.g 3 months from now, on a given date.

I hope you can help. And sorry if I'm not using the correct statistical terms. I have a decent math knowledge, but never did much with statistics.

Assume that the time between events is a Poisson random variable $X\sim\mathcal{P(\lambda})$ with rate $\lambda$. This is a reasonable model under the given circumstances if it is acceptable that the length of the time intervals between events are independent of each other. If your $P_X$ is, for instance, $20$ days, then $\lambda$ is $\frac{1}{20}$ per day.

Say you want to find the probability that an event occurs after $n$ periods, i.e., after a time $nP_X=\frac{n}{\lambda}.$ To find this, you simply have to add the rates (see this answer), so $$p(X\;\text{happens after}\;n\;\text{periods})=\mathcal{P}(n\lambda).$$

It would then be standard to assume that the length of $X$, call it $Y\sim\mathcal{N}(0,\mu)$ where the event after $n$ periods have been placed at the origin, is normally distributed, with some standard deviation $\mu$, which is related to your $T_X$.

• @Timo Please do let me know if I should expand on something; I assumed knowledge about Poisson and Normal distributions, but let me know if you haven't been exposed to these before. – Bobson Dugnutt Apr 14 '17 at 12:14
• Thank you so much for your reply. I really appreciate your help. I'm familiar with normal distribution, but would need to read up on poisson. The one thing I stumble upon is the independence, because the events are not independent of other, I think (sorry for not stating this clearly!). I'll elaborate: Let's say the average period Px is 20 days. If one period is e.g. 30 days it will not affect the length of the next period: The next period is in this case on average still 20 days. Does this make sense? Sorry for not being an expert on proper mathematic definition – Timo Apr 15 '17 at 10:56
• @Timo No problem! You write: If one period is e.g. 30 days it will not affect the length of the next period - that is exactly what independence is, so you're in luck! :) W.r.t. the Poisson distribution, note that it is a discrete distribution; you may think that this is a problem due to time essentially being continuous, but in practice the discreteness is not a problem, since you simply choose a unit of time that is small enough for your purposes (say, days, hours or seconds). – Bobson Dugnutt Apr 15 '17 at 11:06
• @Timo A comment on the independence: Remember that $X$ is a random variable specifying the time in between events, and not the event itself (which is not "a quantity" that you can measure). I will edit my answer to include this point more clearly. – Bobson Dugnutt Apr 15 '17 at 11:10