# How to calculate the boundary value for a random variable which is sum of variables with gamma and uniform distributions?

The variable is a sum of two random variable which obey gamma and uniform distributions, respectively. The parameters of the uniform distribution variable are determined, and the other's must be retrieved from real time calculation.

I want to find the boundary of the summed variable, like using a three sigma rule would do for a normal distribution. Is there any good method to estimate that?

Some inequality, like the Chebyshev inequality, might be too generic of a method so that it will not perform exactly as the three sigma rule would.

• Are you asking how to calculate quantiles for the distribution of variables defined as the sum of a uniform and a gamma random variable? May 5, 2012 at 23:54
• Yes, the quantile function is exactly what i wanted. I tried to use characterization function of the sum to get CDF and inverse it. but the process is too hard to operate, specially for the complexity of integration. May 6, 2012 at 2:11

You are asking for the distribution of the sum of independent random variables, one uniformly distributed, the other gamma. (the Q do not specify independence, but it seems to be assumed).

So let $$Y=U+X$$ where $$U \sim \mathcal{U}(0, b), b>0$$ and $$X\sim \mathcal{Gamma}(\alpha, \beta), \alpha>0, \beta>0$$ where $$\beta$$ is the rate. Write the respective densities as $$g(u)=\frac1b \mathcal{I}(0\le u \le b)$$ and $$h(x)=\frac{\beta^\alpha}{\Gamma(\alpha) } x^{\alpha-1} e^{-\beta x} \cdot \mathcal{I}(x>0)$$ Then we find the density of $$Y$$ with the convolution integral $$f(y) = \int g(u) h(y-u) \; du = \\ \int_0^b \frac1b \frac{\beta^\alpha}{\Gamma(\alpha) }(y-u)^{\alpha-1} e^{-\beta (y-u)} \cdot \mathcal{I}(x>0) \; du$$ These can be solved separately for the two cases $$y \gtrless b$$, by a change of variable and recognizing in the integrand the gamma density, resulting in $$f(y) = \begin{cases} \frac1b F_{\alpha, \beta}(y) & y \le b \\ \frac1b \left\{ F_{\alpha, \beta}(y) - F_{\alpha, \beta}(y-b) \right\} & y > b \end{cases}$$ where $$F_{\alpha, \beta}$$ is the cdf (cumulative distribution function) of the Gamma distribution as above.

Edit

Looking through the answer, it is clear that the gamma distributions special form do not play a role at all. So, whatever the distribution of $$X$$, the answer has the same form. For the sake of generality, let us show this. So, notation as above, but with $$X \sim F$$, whatever cdf, without restrictions. $$\DeclareMathOperator{\P}{\mathbb{P}} \P(Y \le y) = \P(U+X\le y) =\int \P(U\le y-X \mid X=x)\; dF(x) =\\ \int F_U(y-x)\; dF(x)$$ differentiating under the integral gives $$f(y)= \int g_U(y-x)\; dF(x)$$ and using the uniform distribution of $$U$$ $$f(y)= \frac1b \int_{y-b}^y dF(x) = \frac1b \left\{ F_X(y)-F_X(y-b) \right\}$$

• This is a special case of the general result that the density function of the sum of a Uniform$(0,b)$ variable with an independent variable with distribution $F$ (continuous or not) is $y\to F(y)-F(y-b).$ (This is pointed out in the "Intuition from Probability" section in the linked post.) You needn't break your result into two cases.
– whuber
Aug 30, 2023 at 17:16
• +1. But generally you cannot differentiate under the integral unless $F$ itself is differentiable. A rigorous demonstration computes the difference quotient $(f(y+\epsilon)-f(y))/\epsilon$ of the expression $$f(y)=\Pr(X+U\le y)=\frac{1}{b}\int_0^b F(y-u)\,\mathrm du=\frac{1}{b}\int_{y-b}^y F(x)\,\mathrm dx$$ and twice exploits the elementary fact that when $F$ is any integrable non-decreasing function, $$F(a)\epsilon \le \int_{a}^{a+\epsilon}F(x)\,\mathrm dx\le F(a+\epsilon)\epsilon.$$
– whuber
Aug 31, 2023 at 15:37