Probability between two values of a gamma distribution

1k Views Asked by At

I am trying to solve a problem where I have a random variable X that follows a gamma distribution of $\Gamma(\theta = 5, \alpha = 4)$.

I am trying to find the probability of $P(10 \leq X \leq 30)$. Obviously, if this was a normal distribution it would be simple, but I do not know how to approach this problem currently. I am confused on if how to convert it to a $\chi^2$ and how that helps me solve this problem. Thank you

2

There are 2 best solutions below

1
On BEST ANSWER

According to your comment $\alpha=4$ is a shape parameter and $\theta = 5$ is a scale parameter. This problem is trivial to solve in R, where the second parameter is $\lambda = 1/\theta = .2$ (a rate parameter). In R, $\texttt{diff(pgamma(c(10,30), 4, .2))}$ returns $0.7059196.$

Because the shape parameter is an integer, you can indeed express this problem in terms of a chi-squared distribution. Then, using printed tables of chi-squared distributions, you might find entries that give you a numerical solution. (Ultimately, such problems are often solved by computational methods--which, of course, were required to make chi-squared tables.)

I guess the intent of this exercise is for you understand the connection between the gamma family of distributions and its chi-squared subfamily. Perhaps comparing the general PDFs of the two will show you the relationship.

Here is a graph of the relevant density function with dotted lines bounding the area you need to compute.

enter image description here

Notes: (1) See Wikipedia discussions of 'gamma distribution' and 'chi-squared distribution' if your textbook doesn't discuss, shape, scale, rate, and degrees-of-freedom parameters.

(2) This integral can be evaluated by numerical integration. The method is to imitate a finite version of the definition of the Riemann integral: Approximate the desired area by a suitably large number of tall, thin rectangles and sum their areas.

(3) Essentially, method (2) is implemented in the 'integrate' function of R:

integrand = function(x){dgamma(x, 4, .2)}
integrate(integrand, 10, 30)
0.7059196 with absolute error < 7.8e-15

(4) Using one of several Monte Carlo methods, one may simulate a large sample from $\mathsf{Gamma}(4, .2)$ and look at the proportion of the values that lie between 10 and 30. This gives a reasonably good approximation (about two places in the example below):

set.seed(2020);  x = rgamma(10^6, 4, .2)
mean(x>10 & x<30)  # 'mean' of logical vector is its...
[1] 0.705994       # ... proportion of TRUE's
2*sd(x>10 & x < 30)/10^3
[1] 0.0009111897   # aprx 95% margin of sim error
3
On

I hope you understand that this type of approaches really become to stressful and hard to compute by hand although it’s really hard because the integral cannot be made by normal ways, it requieres numerical approaches So try to take a time to learn some kind of computational stuff like R. But if you require the solution by handwriting hold on. I’m working on it