Hi Harj
The possible options for Di are 0 or 1. The possible values for Vi are 0 to bi - ai. Let's consider the possible values for Di.
If Di = 0 then we know that Vi = bi - ai. In other words:
P(Di = 0, Vi = bi - ai) = P(Di = 0) = P(individual i survives the entire period) = exp(-mu * (bi - ai))
P(Di = 0, Vi = vi) for any value of vi that is not bi - ai is 0.
If Di = 1, then Vi can take any value between 0 and bi - ai. The density of Vi conditional on Di being 1 is given by:
exp(-mu * vi) * mu / (1 - exp(-mu * (bi - ai)) for vi between 0 and bi - ai
This is an exponential density divided by the probability of an exponential(mu) RV being between 0 and bi - ai (which Vi must be if Di is 1).
We also have P(Di = 1) = 1 - exp(-mu * (bi - ai))
So:
P(Di = 1, lower < Vi < upper) = P(lower < Vi < upper | Di = 1) P(Di = 1)
= int(lower, upper) exp(-mu * vi) * mu / (1 - exp(-mu * (bi - ai)) dvi * (1 - exp(-mu * (bi - ai)))
= int(lower, upper) exp(-mu * vi) * mu dvi for 0 < lower < upper < bi - ai
The overall probability that Di is either 0 or 1 and Vi is somewhere between 0 and bi - ai is therefore:
P(Di = 0, Vi = bi - ai) + P(Di = 1, 0 < Vi < bi - ai) = exp(-mu * (bi - ai)) + int(0, bi - ai) exp(-mu * vi) * mu dvi
and this must of course be 1.
Hope this helps!
Andy