I want to find out the expectation values of individual waiting times of the Poisson arrivals with rate $\lambda$. Arrivals are served in groups e.g., service will be done when N arrivals or served based on expiry of counter timer with deterministic time value T. Can some one help me how to find the waiting time of the individual arrivals? asssume waiting time of the first is $E[X]$, what is the waiting time of second, third, fourth,.... Thanks in advance.
average time spent
1 Answers
Let arrival be modeled by a poisson process $X=(X_t)_{t\in\mathbb{R}_{\geq0}}$ with rate $\lambda$. $X$ has independent increments and the waiting time between event(arrivals) is exponentially distributed with parameters $\lambda$. Let arrivals be served in chunks of $n$, i.e. service is halted until $n$ are waiting or the time passed from first arrival in the chunk is $T$ at that point everybody waiting will be served at once.
Denote by $X_1$ the waiting time of the first arrival in the batch and similarly $X_2,\dots,X_n$ the waiting times of the following arrivals.
The waiting time can be expressed in the following way ($J_i,\;i=1\dots,n$ are i.i.d. exponentially distributed random varibales with parameter $\lambda$ ): \begin{equation} X_1\overset{d}{=}\min\left(\sum_{i=2}^nJ_i, T \right), \end{equation} which follows since the first has to wait for $n-1$ more arrivals or until $T$-time has passed (together with the properties of the Poisson Process). Analoguously, we get for the other arrivals, \begin{eqnarray} X_j&\overset{d}{=}&\max\left(X_{j-1}- J_j,0\right) \\&\overset{d}{=}&\max\left(\min\left(\sum_{i=j+1}^n J_i,T-\sum_{i=2}^j J_i\right),0\right) \end{eqnarray} for $j=2,\dots,I$ and $I=\inf\{i\vert X_i=0\}$. It makes only sense to consider the waiting times of the arrivals until index $I$ because after this index all waiting will be served and the next arrival has waiting time equal (in law) to $X_1$.
Now we can compute the expected waiting time of arrival $i$ but first recall that the sum of i.i.d. exponential Random variables is a gamma distributed random variable. In our case this gives $\sum_{i=j+1}^n J_i \sim\Gamma(n-j,\lambda)$ : \begin{eqnarray} E[X_1]&=&E\left[\min\left(\sum_{i=2}^nJ_i, T \right)\right] \\ &=&E\left[\min(\Gamma(n-1,\lambda),T)\right] \\ &=&\int_0^T x \cdot \frac{\lambda^n-1}{\Gamma(n-1)} x^{n-1} e^{-\lambda x} dx \end{eqnarray} evaluating this integral will give you an expression involving the incomplete gamma function. \begin{eqnarray} E[X_j]&=&E\left[\min\left\{\Gamma(n-j,\lambda),\max(T-\Gamma(j-1,\lambda),0)\right\}\right] \end{eqnarray} where $\Gamma(n-j,\lambda)$ and $\Gamma(j-1,\lambda)$ are independent gamma distributed random variables, hence this expectation can be computed by conditioning on $\Gamma(n-j,\lambda)$ and then integrating .. \begin{eqnarray} E[X_j]=\int_0^T \frac{\lambda^{j-1}}{\Gamma(j-1)} x_2^{j-1}e^{-\lambda x_2}\int_0 ^{T-x_2}x_1 \frac{\lambda^{n-j}}{\Gamma(n-j)}x^{n-j} e^{-\lambda x_1} dx_1 dx_2,\quad j=2,\dots,I. \end{eqnarray}
-
0@Vincert Dear Vincent, many thanks for your description. I understood your approach and its correct. Actually the waiting time of the first arrival, I modeled it and the answers matching with simulations. I would like to discuss how I am doing. Actually the first arrival either waits for $T_{max} $ if we could not receive sufficient arrivals in this duration, say $r$, or it will wait for $(r-1)/ \lambda$ times the CDF associated with the $r^{th}$ arrival. I used Erlang as it is just a case of gamma distribution when the stages are considers as integers, so we have $r-1$ stages. – 2017-02-14
-
0So what I did is here: for calculating expectation value of waiting time of first arrival: As the first arrival triggers the counter timer at t=0, and we need $r-1$ more arrivals to send before timer expiry. On the other hand, if we recieve less than $r-1$ arrivals, the first arrival waiting time would be offcourse $T_{max} $ (your approach also says the same thing I am happy with that). – 2017-02-14
-
0So, I computed prob. using the standard Poisson formula for $0 to 'r-2'$ and multiplied with $T_{max} $ and the last Probability of $r-1$ arrivals is calculated by subtracting all previous prob. for $0 to 'r-2'$ arrivals from 1, and multipled with Erlang(r-1,lambda) distribution i.e., $(r-1)/ \lambda$. The results match with my simulation. – 2017-02-14
-
0Now, I was thinking , I have the max. waiting time of the first arrival out of 'r' arrivals. As we know arrival time of packet following poisson is 1/lambda, so , I said the waiting time of the second arrival should be $1/\lambda$ less than the first arrival waiting time. But, this is not right as it works for higher lambda values when aggregation is done due to arrival of 'r' packets but for lower lambda values, it does not fit. I checked with simulator. – 2017-02-14
-
0E.g., if I use $T_{max} $ = 50ms, then for smaller lambda values, the waiting time of second arrival gives terrible values when I used this approach $E[X]_{2}=E[X]_{1}-1/\lambda$ as $1/\lambda$ values get larger than E[X]_{1}. I can put a bound condition with min(0, $1/\lambda$), it makes the waiting time of second also positive for lower lambda, but not gives good results. – 2017-02-14
-
0Also, I am not sure, wether we can just do like this or not? I mean subtracting $1/\lambda$ from the waiting time of first? because the first arrivals always appear at t=0 to trigger timer, remaining arrivals follows poisson process, therefore whether its right to say the distance between first and second is $1/\lambda$ on average. I hope I delivered you my approach clearly? please let me know if you need further clarification to tackle this problem. I thanks alot for your help. Many thanks in advance. – 2017-02-14
-
0@Hallian1990, you can not simply substract the mean of the interarrival. In the expression for $X_j$ there are a min and max, simply substracting $\frac{1}{\lambda}$ would neglect the min and max which results in possibly negative values. If you want to compute the waiting time you can use (e.g.) Monte Carlo. – 2017-02-14
-
0@Vincert. OK Thanks. So, considering the approach that I have discussed, any idea how to find the waiting time of second arrival if I already compute the waiting time of the first arrival as I have explained? – 2017-02-14
-
0@Hallian1990 Now I understand, let me think about it for a while. – 2017-02-14
-
0@ Vincent Yes Sure, thank you! – 2017-02-14
-
0@Hallian1990 as I understand you want to get a recursion for the expected waiting times.. I think it is not possible to express $EX_2$ in terms of $EX_1$ due to the max and min in the above recursion - $X_j\overset{d}{=}\max\left(X_{j-1}- J_j,0\right)$ - as you loose to much information taking the expectation. Basically in the expectation every possible scenario is weighted by the probability it occurs and then summed up. This summation results in loss of information that is needed for the next recursion. – 2017-02-14
-
0@ Vincent. OK. Let me try to compute the results from the expressions you proposed. Well can they be further simplified? Let me try. Will come back to you. – 2017-02-14
-
0@Hallian1990 . Would you mind opening a new question containing g your last question? This comment section gets a bit messy.. I will have a look at that new question then. This will also have the positive effect that it might be seen by others who might contribute. – 2017-02-14