# How to get this analytical results for probability of wait times

I'm working with a continious-time stochastic process, where a particular event may happen at some time t with an unkown underlying distribution.

One "run" of a simulation of this process will result in a series of event times for each time the event happened within the run. So the output is just $$[t_1, t_2, ... t_n]$$.

From this output I'm trying to calculate a metric I'll call $$u$$, which is defined as "the probability that if you choose a random time $$t$$ within a run and look within the time range $$[t, t+L]$$ (for a pre-specified L), that at least one event occured in that range".

I've found some documentation (from an employee long gone from the company) that gives an analytical form for $$u$$ and I've verified that this form aligns very well with experimental data, but I haven't been able to recreate the deductions that lead to this form.

The analytical form makes use of a probability density function of wait times $$f(t)$$ where wait time is simply the time between conseuctive events. So the experimental wait times are simply $$[t_1, t_2-t_1, t_3-t_2, ... t_n - t_{n-1}]$$

The form I'm given is: $$u = 1 - \frac{\int_{t=L}^{\inf} (t-L)f(t)}{\int_{t=0}^{\inf} tf(t)}$$, where $$t$$ is wait time

It's clear that $$\frac{\int_{t=L}^{\inf} (t-L)f(t)}{\int_{t=0}^{\inf} tf(t)}$$ is the disjoint probability that in this random time range of length L, no events occur, but I'm still not clear on how the exact terms are arrived at.

In my attempt to make sense of it I've reconstructed it into $$u= 1 - \frac{E(t-L | t > L)P(t > L)}{E(t)}$$

which makes some inuitive sense to me, but I still can't find a way to start with the original problem and arrive at any of these forms of the analytical solution.

Any guidance on this would be greatly appreciated

• Did you copy the integrals literally? There is no differential term like $dt$? – Sextus Empiricus Nov 22 '20 at 20:51

In your question you state that the inter-event times have a distribution with associated pdf $$f$$. This implies that the inter-event times are identically distributed. If we assume further that the times are independent (which seems like a standard assumption to me), then the number of events $$N(t)$$ occurring in the time interval $$[0,t]$$ is a renewal process. A good introduction to the theory of such processes is chapter 10 in the book Probability and Random Processes by Grimmett and Stirzaker.

Section 10.3 of the book introduces the concept of excess lifetime $$E(t)$$ for renewal processes. This is the time until the next event if we start observing the process at time $$t$$. The metric $$1-u$$ is the probability that there are no events in the time interval $$[t,t+L]$$, which is the probability that $$E(t)>L$$. In other words $$u=1-P(E(t)>L)$$. Although, in general, the distribution of $$E(t)$$ depends on $$t$$, Theorem 10.3.5 in the book states (given very mild conditions on the renewal process) that, as $$t\to \infty$$, $$P(E(t)\leq L)\to \frac{1}{\mu}\int_0^L (1-F(x))dx$$ where $$\mu$$ is the expected inter-event time and $$F$$ is the cdf of the inter-event time. So, it seems reasonable to say that, for large $$t$$, $$u \approx \frac{1}{\mu}\int_0^L (1-F(x))dx$$. Apply integration by parts to this integral and you obtain $$u \approx 1 - \frac{\int_{x=L}^{\infty} (x-L)f(x)dx}{\int_{x=0}^{\infty} xf(x)dx}$$, which matches the expression you give in your question. (NB your notation is a bit confusing as you use $$t$$ in two different ways.)

• Thank you for the thorough and insightful answer. This is exactly the reference I needed. – SP812 Nov 28 '20 at 0:32
• After going through the book, the theory in chapter 10 helped a lot. However, I'm having some trouble with the integration by parts to get the final form (no integration by parts setups I've tried have led to the final form). Is there any hint you could provide there? – SP812 Dec 9 '20 at 23:17
• Try using $\int_0^L (1-F(x))dx=[x(1-F(x)]_0^L+\int_0^L xf(x)dx$ and use that $1-F(L)=\int_L^\infty f(x)dx$ – S. Catterall Dec 9 '20 at 23:49
• Got it! Thank you yet again! – SP812 Dec 10 '20 at 4:13

There is a certain correspondence between probability for a certain waiting time and probability for a certain number of events within some time.

In your situation, the probability of no event within time period $$L$$ is the probability that the waiting time is longer than $$L$$. The events are the same. If you start waiting at the beginning of the time period and after $$L$$ time no event occurred then the waiting time is longer than $$L$$ and the number of events in the time period $$L$$ are zero.
So for the probability of at least one event within the time period $$L$$ (which is the complement from no event within the time period $$L$$) you need to use
$$1 - P(t>L)$$