In this question, I asked:
If we have that: $\tau_i \overset{\text{independent}}{\sim} \exp(\lambda_i)$, for $i=1,2,3,...,n$, where $\lambda_i\neq \lambda_j, \forall i\neq j$ then I would like to find a general form for the probability:
$$ \text{Pr}(\sum_{i=1}^{n-1} \tau_i \leq t, \sum_{i=1}^{n} \tau_i > t) $$
and I received an answer from Ben:
$$ \sum_{i=1}^{n-1} m_{n,i} \cdot [ \exp (- \lambda_i t) - \exp (- \lambda_n t) ], $$
where the terms $m_{n,j}$ are defined as:
$$ m_{n,i} = \frac{\lambda_i}{\lambda_n} \prod_{j=1 \\ j \neq i}^{n} \frac{\lambda_j}{\lambda_j-\lambda_i}. $$
I have found that when $n$ is moderately big (even above say 10), that the probabilities calculated by the above rule can become negative computationally. I.e. since the $m_{n,i}$ can be both positive and negative, the precision of their calculation can really matter to ensure the probabilities come out positive.
I would like to know if there is a computationally stable way of calculating the log-probability?
Note: I have realised that a part of $m_{n,i}$ is what is known as a Lagrange polynomial:
$$ l_j(0) := \prod_{j=1 \\ j \neq i}^{n} \frac{\lambda_j}{\lambda_j-\lambda_i}, $$
which does have a stable form defined here. I have tried this though and I can still get negative probabilities for moderately sized n. This is partly why I am hoping I can find a more stable expression for the log-probability; it is also more convenient to work with the log-probability because I am doing MCMC that uses this.
Note: it is not straightforward to use some of the clever solutions for stabilising a log of a sum devised here because the $m_{n,i}$ can be negative.