Tutorials › VEE Mathematical Statistics › Normalizing the Gamma Density

VEE Mathematical Statistics · Gamma, Beta, and Normal Models · Tutorial 198 of 880

Normalizing the Gamma Density

Learn how the gamma function normalizes shape-rate and shape-scale gamma densities, and verify the result for both integer and non-integer shapes.

Intermediate 9 min read

What You'll Learn

  • Define the gamma integral and state the conditions under which it converges.
  • Derive the normalizing constant for shape-rate and shape-scale gamma densities.
  • Use integration by parts to connect integer gamma-function values to factorials.
  • Verify normalization for integer and non-integer shape parameters.
  • Identify common errors involving the support, shape, rate, and scale.

Why a Gamma Density Needs a Normalizing Constant

A nonnegative variable can have a density proportional to \(x^{\alpha-1}e^{-\beta x}\) without that expression integrating to one. To turn it into a probability density, we need the exact constant that makes its total area equal to one. The gamma function supplies that constant for every positive shape parameter, not only for integer shapes.

The key conditions are \(\alpha>0\) and \(\beta>0\). The first controls the behavior near zero; the second ensures exponential decay as \(x\) grows. A proposed gamma density with a nonpositive shape or rate does not meet these conditions and cannot be normalized by the formulas developed here.

Definition: For \(a>0\), the gamma function is $$ \Gamma(a)=\int_0^\infty t^{a-1}e^{-t}\,dt. $$ It is a function of a positive real argument. It is not itself a probability density.

The integral is finite when \(a>0\). Near zero, the factor \(e^{-t}\) stays bounded and \(t^{a-1}\) is integrable precisely when \(a-1>-1\), or \(a>0\). At large \(t\), the exponential factor decays fast enough that the integral converges for every fixed real \(a\). Thus the gamma integral is available for integer and non-integer positive arguments.

Deriving the Shape-Rate Normalizing Constant

Suppose \(X\) is modeled by a gamma distribution with shape \(\alpha>0\) and rate \(\beta>0\). Start with the nonnegative kernel \(x^{\alpha-1}e^{-\beta x}\) on \(x>0\), and let \(c\) be its normalizing constant. The required condition is \(c\int_0^\infty x^{\alpha-1}e^{-\beta x}\,dx=1\). Use the substitution \(t=\beta x\), so \(x=t/\beta\) and \(dx=dt/\beta\):

$$ \int_0^\infty x^{\alpha-1}e^{-\beta x}\,dx = \int_0^\infty \left(\frac{t}{\beta}\right)^{\alpha-1}e^{-t}\frac{dt}{\beta} = \frac{1}{\beta^\alpha}\int_0^\infty t^{\alpha-1}e^{-t}\,dt = \frac{\Gamma(\alpha)}{\beta^\alpha}. $$

Therefore \(c\) must be the reciprocal of this integral. The density is

Theorem: If \(\alpha>0\) and \(\beta>0\), the shape-rate gamma density is $$ f_X(x)=\frac{\beta^\alpha}{\Gamma(\alpha)}x^{\alpha-1}e^{-\beta x}, \qquad x>0, $$ and \(f_X(x)=0\) for \(x\leq 0\). The parameter \(\beta\) is a rate, so it has reciprocal units to \(x\).

This derivation establishes normalization directly: integrating the displayed density over \(x>0\) gives \(\beta^\alpha\Gamma(\alpha)^{-1}\) times \(\Gamma(\alpha)/\beta^\alpha\), which is one. The support matters. The formula is not a density on the whole real line; its values for \(x\leq 0\) are zero.

Worked Example: Normalizing an Integer-Shape Kernel

A positive measurement \(X\) is assigned a density proportional to \(x^3e^{-3x}\) for \(x>0\), and zero otherwise. Find the normalizing constant, then verify the density integrates to one. Use the shape-rate method and avoid the mistake of treating the rate \(3\) as a scale.

Step 1: Identify the parameters. The power is \(x^{\alpha-1}=x^3\), so \(\alpha=4\). The exponential term is \(e^{-\beta x}=e^{-3x}\), so the rate is \(\beta=3\).

Step 2: Evaluate the gamma function. For this integer shape, \(\Gamma(4)=3!=6\). Hence the integral of the unnormalized kernel is \(\Gamma(4)/3^4=6/81=2/27\).

Step 3: Take the reciprocal. The constant is \(c=1/(2/27)=27/2\). Thus \(f_X(x)=(27/2)x^3e^{-3x}\) for \(x>0\), and zero otherwise.

Check. Its integral is \((27/2)(2/27)=1\), as required. Using \(3^{-4}\) in place of \(3^4\) for the constant would reverse the rate scaling and fail this check.

Why Integer Shapes Give Factorials

For \(a>0\), integration by parts gives the recurrence relation for the gamma function. Take \(u=t^a\) and \(dv=e^{-t}dt\), so \(du=at^{a-1}dt\) and \(v=-e^{-t}\). The boundary term \(-t^ae^{-t}\) vanishes at both endpoints: it tends to zero at zero because \(a>0\), and at infinity because exponential decay dominates a fixed power. Therefore

$$ \Gamma(a+1) = \int_0^\infty t^ae^{-t}\,dt = a\int_0^\infty t^{a-1}e^{-t}\,dt = a\Gamma(a). $$

Also, \(\Gamma(1)=\int_0^\infty e^{-t}dt=1\). Repeatedly applying the recurrence gives \(\Gamma(n)=(n-1)!\) for each positive integer \(n\). This explains why a gamma density with integer shape has a factorial in its normalizing constant. The recurrence applies to positive real \(a\) as well, so the gamma function is not restricted to factorial-like integer inputs.

Non-Integer Shapes and the Gamma Function at One-Half

Some non-integer gamma-function values have useful exact forms. In particular, \(\Gamma(1/2)=\sqrt{\pi}\). To see why, substitute \(t=u^2\) in the defining integral. Then \(dt=2u\,du\), and \(t^{-1/2}=1/u\), giving \(\Gamma(1/2)=2\int_0^\infty e^{-u^2}du\). The integrand is even, so this equals \(\int_{-\infty}^\infty e^{-u^2}du\).

For completeness, let \(I=\int_{-\infty}^\infty e^{-u^2}du\). Squaring the integral and using a double integral over the plane gives \(I^2=\int_{\mathbb R^2}e^{-(x^2+y^2)}dx\,dy\). Polar coordinates, with radius \(r\) and angle from \(0\) to \(2\pi\), yield \(I^2=2\pi\int_0^\infty re^{-r^2}dr=\pi\), since the substitution \(w=r^2\) gives \(\int_0^\infty re^{-r^2}dr=1/2\). As \(I>0\), \(I=\sqrt{\pi}\), proving the stated value.

Worked Example: Normalizing a Half-Shape Density

A positive duration \(X\) has a kernel \(x^{-1/2}e^{-4x}\) on \(x>0\). Find its normalizing constant and verify the result. Use the gamma integral, and do not assume that the shape must be an integer.

Step 1: Identify shape and rate. Since \(x^{-1/2}=x^{\alpha-1}\), the shape is \(\alpha=1/2\). The rate is \(\beta=4\).

Step 2: Find the kernel's integral. By the rate-scaling substitution, \(\int_0^\infty x^{-1/2}e^{-4x}dx=\Gamma(1/2)/4^{1/2}\). Using \(\Gamma(1/2)=\sqrt{\pi}\) and \(4^{1/2}=2\), this is \(\sqrt{\pi}/2\).

Step 3: Normalize. The reciprocal is \(c=2/\sqrt{\pi}\). Therefore \(f_X(x)=(2/\sqrt{\pi})x^{-1/2}e^{-4x}\) for \(x>0\), and zero otherwise.

Check. The integral of this proposed density is \((2/\sqrt{\pi})(\sqrt{\pi}/2)=1\). The shape is positive, so the singularity at zero is integrable; an infinite density value at the single point \(x=0\) is not required for the density to be invalid.

Shape-Scale Form and a Non-Integer Check

Some problems use a scale parameter \(\theta>0\) rather than the rate \(\beta\). The two parameterizations describe the same form when \(\theta=1/\beta\). Substituting \(\beta=1/\theta\) in the shape-rate density gives the shape-scale form below.

Definition: For shape \(\alpha>0\) and scale \(\theta>0\), the shape-scale gamma density is $$ f_X(x)=\frac{1}{\Gamma(\alpha)\theta^\alpha}x^{\alpha-1}e^{-x/\theta}, \qquad x>0, $$ and it is zero for \(x\leq 0\). The scale \(\theta\) has the same units as \(x\), whereas the equivalent rate is \(\beta=1/\theta\).

Worked Example: Checking a Non-Integer Shape-Scale Density

A positive calibration time is modeled with shape \(\alpha=5/2\) and scale \(\theta=2\). Write its normalized density explicitly and verify the normalizing constant. Use the shape-scale form, and avoid substituting the scale directly where a rate belongs.

Step 1: Evaluate the required gamma value. The recurrence gives \(\Gamma(5/2)=(3/2)\Gamma(3/2)=(3/2)(1/2)\Gamma(1/2)=3\sqrt{\pi}/4\).

Step 2: Compute the coefficient. Since \(2^{5/2}=4\sqrt{2}\), the coefficient is \[ \frac{1}{\Gamma(5/2)2^{5/2}} = \frac{1}{(3\sqrt{\pi}/4)(4\sqrt{2})} = \frac{1}{3\sqrt{2\pi}}. \] Thus \(f_X(x)=\frac{1}{3\sqrt{2\pi}}x^{3/2}e^{-x/2}\) for \(x>0\), and zero otherwise.

Step 3: Verify the integral. The integral of \(x^{3/2}e^{-x/2}\) is \(\Gamma(5/2)/(1/2)^{5/2}=\Gamma(5/2)2^{5/2}\). Multiplying by the proposed coefficient \(1/(\Gamma(5/2)2^{5/2})\) gives one.

Check. The exponent is \(e^{-x/\theta}=e^{-x/2}\), consistent with scale \(2\); the equivalent rate is \(1/2\). The density is normalized and has the required positive support.

Common Errors and a Reliable Check

Normalization problems often become simpler when the kernel is matched to the standard gamma integral before any arithmetic is done. The following checks catch the most consequential errors.

  • Confusing rate and scale. In the exponent, rate form uses \(e^{-\beta x}\); scale form uses \(e^{-x/\theta}\). The relationship is \(\beta=1/\theta\), not \(\beta=\theta\).
  • Using the exponent's power as the shape. Match \(x^{\alpha-1}\), so a power \(x^3\) corresponds to \(\alpha=4\), not \(3\).
  • Forgetting the rate or scale power. The shape-rate coefficient contains \(\beta^\alpha\); the shape-scale coefficient contains \(\theta^{-\alpha}\).
  • Ignoring the support. A gamma density is zero for \(x\leq0\). The integral defining its normalizer is over the positive half-line.
  • Assuming only integers are allowed. The defining integral and normalization result hold for every \(\alpha>0\). Factorials are only the special integer case.
1
Match the kernel.
Write the power as \(x^{\alpha-1}\) and identify whether the exponential uses a rate or a scale.
2
Check parameter conditions.
Confirm that the shape is positive and that the rate or scale is positive.
3
Apply the gamma integral.
Use \(\Gamma(\alpha)/\beta^\alpha\) for the integral of a rate-form kernel, or \(\Gamma(\alpha)\theta^\alpha\) for a scale-form kernel.
4
Take the reciprocal and check.
Multiply the kernel integral by the proposed coefficient; the result must equal one.

The normalizing constant is more than a formal detail: it is what makes probabilities calculated from a density consistent with total probability one. The gamma integral also allows the same density form to cover a continuum of positive shapes, while the recurrence provides an efficient route to exact values when the shape is an integer or a half-integer. This treatment is aligned with the SOA VEE Mathematical Statistics syllabus.

Check Your Understanding

For each problem, identify the shape and rate or scale before finding the constant. Verify your result by matching the corresponding gamma integral.

  1. A kernel is \(c x^2e^{-5x}\) for \(x>0\). Find \(c\). (Answer: \(125/2\))
  2. A shape-rate gamma density has shape \(3/2\) and rate \(4\). Find its coefficient multiplying \(x^{1/2}e^{-4x}\). (Answer: \(16/\sqrt{\pi}\))
  3. A shape-scale gamma density has shape \(5\) and scale \(2\). Find its coefficient multiplying \(x^4e^{-x/2}\). (Answer: \(1/768\))
  4. A kernel is \(c x^{-2/3}e^{-x}\) for \(x>0\). Find \(c\) in terms of the gamma function. (Answer: \(1/\Gamma(1/3)\))
  5. A shape-scale density has shape \(5/2\) and scale \(6\). Find the coefficient multiplying \(x^{3/2}e^{-x/6}\), giving an exact expression. (Answer: \(4/(3\sqrt{\pi}\,6^{5/2})\))
Clinical Biostats