Modeling nearest event through multivariate random variable with condition There are two time sequences in my system, one of them represents IN events, and the other OUT events. Each IN event would be released by the nearest following OUT event or reaching the deadline. I want to get the pdf of the interval between the time the IN event is triggered until the time it is released (OUT event occurs or censored at deadline).
As the following figure shows, $t_a$, $t_r$, $t_r^'$ represent the IN event time, the nearest OUT event time and last OUT event time prior to $t_r$. The nearest OUT event can be represented as $t_r>t_a$ and $t_r^' < t_a$. I extend the situation to statistics, so that $t_a$ is a sample of random variable $T_a \sim U(0,T)$. $t_r$ obey $T_r \sim U(0,2T)$. The interval of two OUT event, $t_r-t_r^'$, should be treated as $T_i \sim Exp(\lambda)$.  

How to model this complex multivariate random variable and get its pdf? 
Furthermore, deadline of event $t_a$ is $2T$, which means that if there is no $t_r$ between $(t_a, 2T)$, it would be released at time $2T$. This condition could introduce more difficulty of modeling.
 A: *

*You have defined the model based on the defined times to events in your question. You have two point processes with censoring times.  The time to events [IN events and OUT events] is defined in your post.

*The time 2T just amounts to a censoring time which is handled routinely in survival analysis if you just assume the OUT event occurs beyond 2T but since you are assuming the OUT event does occur at 2T if not before that amounts to truncating its distribution.

*Since the time between out events is exponential the lack of memory property says that given the in event occurs at time t$_a$ does not change the distribution of the time to the next event. So the time from t$_a$ to the next OUT event is still exp(λ).  But given that the out event is truncated at time 2T the actual distribution that you want is 
V = min(t$_1$, t$_2$) where t$_1$ is distributed 
exp(λ) and t$_2$=2T-t$_a$.  This just makes the probability 
given t$_a$ that V=2T-t$_a$ is the probability that an exp(λ) random variable E is greater 
than 2T-t$_a$. and it follows the exp(λ) density when 
0 < E < 2T-t$_a$. 
