Variance for time until event with exponential wait time and geometric chance of ceasing

132 Views Asked by At

Consider an event such that the time between consecutive events is exponentially distributed with a mean of $1$ time unit. After each event, there is a $1/2$ chance of no more events occurring. How does one find the variance of the time it takes until the final event occurs?

To my understanding, the time until the nth event is a gamma distribution with $k=n, \theta=1$, giving a mean of $k\theta=n$ and variance of $k\theta^2=n$. This is, of course, before considering the fact that events eventually cease, and that the final event is the one of interest. As each event has a 1/2 chance of being the final one, that gives a geometric distribution with a mean of $2$ events occurring, and variance of $(1-1/2)/(1/2)^2=2$. Now, I believe the mean time until the final event can be obtained by essentially setting the $n$ for the gamma distribution to the mean of the geometric one, giving a mean of $2$, but I am unsure as to how to determine variance.

It appears the correct variance is $4$, but I do not know how this is obtained.

2

There are 2 best solutions below

0
On

The number of events is $1+N$ where $N \sim \text{Geometric}(1/2)$. So we have to wait $N$ times (assuming the first event occurs immediately).

If there are $n+1$ events (i.e., we have to wait $n$ times), then as you said the total waiting time has the distribution $\text{Gamma}(n,1)$. But since the number of events is random, the total waiting time is $T \sim \text{Gamma}(N,1)$.

So to compute the variance of $T$, we need to use the Law of Total Variance. This says that: $$\text{Var}(T) = \mathbb{E}[\text{Var}(T \mid N)] + \text{Var}(\mathbb{E}[T \mid N]).$$ As you noted, the variance of the $\text{Gamma}(n,1)$ distribution is $n$, so $\text{Var}(T\mid N) = N$. So the first term becomes $\mathbb{E}[N] = \frac{1}{1/2} = 2$.

You also noted the mean of the $\text{Gamma}(n,1)$ distribution is $n$, so $\mathbb{E}[T \mid N] = N$. Hence the second term becoesm $\text{Var}(N) = \frac{1-1/2}{(1/2)^2}=\frac{1/2}{1/4}=2.$

Adding these together we get $\text{Var}(T) = 4$.

0
On

The model is parametrized as follows. Let $N$ be the counting random variable for the total number of events observed; thus $$N \sim \operatorname{Geometric}(p = 1/2)$$ with $$\Pr[N = n] = (1-p)^{n-1} p = 2^{-n}, \quad n = 1, 2, \ldots.$$ Here I have chosen a parametrization where at least one event is assured to occur. Then, let $T$ be the time-to-event random variable, which measures the total time to observe the final event. Conditioned on $N$, we have $$T \mid N \sim \operatorname{Gamma}(N, \theta = 1)$$ with $$f_{T \mid N}(t) = \frac{t^{N-1} e^{-t/\theta}}{\theta^N \Gamma(N)} = \frac{t^{N-1} e^{-t}}{(N-1)!}, \quad t > 0.$$ Then the marginal/unconditional time-to-event random variable has density $$f_T(t) = \sum_{n=1}^\infty f_{T|N = n}(t) \Pr[N = n] = \sum_{n=1}^\infty 2^{-n} \frac{t^{n-1} e^{-t}}{(n-1)!}.$$ I leave the evaluation of this sum to you as an exercise.

It is of course not required to perform this computation to obtain the mean and variance of $T$. Note by the law of total expectation, $$\operatorname{E}[T] = \operatorname{E}[\operatorname{E}[T \mid N]] = \operatorname{E}[\theta N] = \theta \operatorname{E}[N] = \frac{\theta}{p}.$$ The evaluation of the inner expectation arises from the fact that the mean of a gamma distribution with shape $N$ and scale $\theta$ is $N \theta$, and the evaluation of the outer expectation is simply the expectation of a geometric distribution with support on the (strictly) positive integers.

To compute the variance, we apply the law of total variance: $$\begin{align*}\operatorname{Var}[T] &= \operatorname{E}[\operatorname{Var}[T \mid N]] + \operatorname{Var}[\operatorname{E}[T \mid N]] \\ &= \operatorname{E}[\theta^2 N] + \operatorname{Var}[\theta N] \\ &= \theta^2 \operatorname{E}[N] + \theta^2 \operatorname{Var}[N] \\ &= \frac{\theta^2}{p} + \frac{\theta^2(1-p)}{p^2} \\ &= \frac{\theta^2}{p^2} \end{align*}$$ where again, we have simply used the formulas for the variances of the aforementioned gamma and geometric distributions.

Finally, if you have performed the explicit computation of the unconditional density $f_T(t)$, and you recognize the parametric family of this distribution, you could just as easily compute the mean and variance that way, which should give you the same results as with the laws of total expectation and variance.