0

I have response times in seconds of 3 tasks which follow Gamma distribution: F ~ $\Gamma(k_1, θ_1)$, G ~ $\Gamma(k_2, θ_2)$, H ~ $\Gamma(k_3, θ_3)$. Tasks 1 and 2 run in parallel, but task 3 runs after the first two. From this setup my goal is to calculate the probability of all tasks being executed within x seconds.

Currently my though was to do it like this: FG+H.

After that I would have my final shape and scale values calculate the probability. Is my approach correct?

  • 2
    If "Tasks 1 and 2 run in parallel" I would have thought you might want the maximum rather than the product. – Henry Jan 19 '23 at 11:48
  • 1
    Even if multiplication was the answer, there is a distinction between multiplying two random variables, multiplying two densities, and multiplying two (complementary) cumulative distribution functions – Henry Jan 19 '23 at 11:52
  • @Henry What is confusing me is that task 3. If I had only tasks 1 and 2, then I could calculate the probability for both tasks being executed within x seconds and then multiply those probabilities, am I correct? But how should I approach this now to get the final probability? – new_guy Jan 19 '23 at 12:27
  • 1
    For the sum of two independent random variables, you want the convolution of their distributions, which sometimes is easy but otherwise not. If they are non-negative and at least one has a density you might have something like $P(X+Y \le k)=\int_{x=0}^k F_Y(k-x)f_X(x), dx$ – Henry Jan 19 '23 at 14:24
  • Even in the simpler case of adding two Gamma variables with different rates you get a complicated distribution that cannot fully be characterized merely with a shape and scale. See https://stats.stackexchange.com/questions/72479. In your case the results are even worse than that -- and simple formulas like those you propose would only be approximations (to what?) and are likely not to be good ones. So, are you really looking for such approximations or do you want your original question ("calculate the probability of all tasks being executed") answered? – whuber Jan 19 '23 at 15:29
  • @Henry Thank you for you input. As I understand, both steps in my approach are incorrect. But what I don't understand is how should I approach this, i.e. what should my approach be and how should the final formula look like in regards to $k_1$, $θ_1$, $k_2$, $θ_2$, $k_3$, $θ_3$ (or the respective means and standard deviations of the 3 data samples)? – new_guy Jan 19 '23 at 17:39
  • @whuber The goal still is to calculate the probability of all tasks being executed but if it is easier to get a fairly accurate result using approximations, then that approach works too. – new_guy Jan 19 '23 at 17:40
  • One of the best possible ways to get a specific answer is numerical integration. If you want a general answer as a function of the parameters, approximations might help. – whuber Jan 19 '23 at 17:48
  • @whuber Regarding the first part - tasks 1 and 2 which run in parallel - if I had only tasks 1 and 2, would then the result be a gamma distribution? If so then for the second step I could use the R code from kjetil b halvorsen's answer from the link you provided. – new_guy Jan 19 '23 at 18:00
  • Unfortunately, no: the maximum of two (independent) Gamma distributions is not a Gamma distribution. It might also be worth noting that the answer on the Math site would be irrelevant even if you wanted to multiply two Gamma-distributed variables, because the density of the product is not the product of the densities. – whuber Jan 19 '23 at 18:09

0 Answers0