askvity

How to Find Variance of a Probability Density Function?

Published in Probability Variance Calculation 4 mins read

To find the variance of a probability density function (PDF) for a continuous random variable, you typically use the formula based on expected values. The variance measures the spread or dispersion of the distribution around its mean.

The Core Formula for Variance

The variance of a random variable $X$, often denoted as $\text{Var}(X)$ or $\sigma^2$, is defined using its expected values. The most common and practical formula is:

Variance = $E(X^2) - [E(X)]^2$

Here:

  • $E(X)$ is the expected value of $X$, which is also the mean ($\mu$) of the distribution.
  • $E(X^2)$ is the expected value of $X$ squared.
  • $[E(X)]^2$ is the square of the expected value of $X$ (the mean squared).

This formula implies that you need to calculate two quantities: the expected value of $X$ and the expected value of $X^2$, based on the given probability density function $f(x)$.

Calculating Expected Values for a PDF

For a continuous random variable $X$ with a probability density function $f(x)$ defined over the range $(-\infty, \infty)$, the expected values are calculated using integration:

Expected Value of X (Mean)

The expected value of $X$, $E(X)$, is calculated by integrating $x$ multiplied by the PDF over the entire range of possible values for $X$:

$E(X) = \int_{-\infty}^{\infty} x \cdot f(x) dx$

If the PDF is defined over a specific interval, say $[a, b]$, the integral is taken over that interval:

$E(X) = \int_{a}^{b} x \cdot f(x) dx$

This value represents the theoretical average or mean of the random variable.

Expected Value of X-Squared

The expected value of $X$ squared, $E(X^2)$, is calculated similarly, but by integrating $x^2$ multiplied by the PDF:

$E(X^2) = \int_{-\infty}^{\infty} x^2 \cdot f(x) dx$

Or, if the PDF is defined over $[a, b]$:

$E(X^2) = \int_{a}^{b} x^2 \cdot f(x) dx$

Step-by-Step Guide to Finding Variance

Here are the steps to find the variance of a PDF $f(x)$:

  1. Determine the PDF: Identify the specific probability density function $f(x)$ for the random variable $X$ and its range of values.
  2. Calculate $E(X)$: Compute the expected value of $X$ by evaluating the integral $\int x \cdot f(x) dx$ over the valid range of $x$. This gives you the mean, $\mu$.
  3. Calculate $E(X^2)$: Compute the expected value of $X^2$ by evaluating the integral $\int x^2 \cdot f(x) dx$ over the valid range of $x$.
  4. Calculate $[E(X)]^2$: Square the value obtained in Step 2.
  5. Apply the Variance Formula: Substitute the values from Step 3 and Step 4 into the formula: $\text{Variance} = E(X^2) - [E(X)]^2$.

The result will be the variance of the continuous random variable.

Example Insight

The reference provided highlights the final step for calculating variance using the $E(X^2) - [E(X)]^2$ formula for a specific distribution parameterized by $\alpha$. It shows:

Variance = $E(X^2) - [E(X)]^2 = 2\alpha^2 - (1/\alpha)^2 = 2\alpha^2 - 1/\alpha^2 = 1/\alpha^2$

This shows that for this particular distribution:

  • The calculation for $E(X^2)$ resulted in $2\alpha^2$.
  • The calculation for $E(X)$ resulted in $1/\alpha$, so $[E(X)]^2$ is $(1/\alpha)^2$.
  • Subtracting these values gives $2\alpha^2 - 1/\alpha^2$, which simplifies to $1/\alpha^2$ for that specific case.

This example reinforces the method: calculate $E(X^2)$ and $E(X)$ first, and then apply the variance formula.

Summary of Key Formulas

Quantity Formula for PDF $f(x)$ defined on $[a, b]$ Purpose
Mean $E(X)$ $\int_{a}^{b} x \cdot f(x) dx$ Measure of central tendency
$E(X^2)$ $\int_{a}^{b} x^2 \cdot f(x) dx$ Used in variance calculation
Variance $E(X^2) - [E(X)]^2$ Measure of dispersion or spread
Std. Deviation $\sqrt{\text{Variance}}$ Square root of variance

Finding the variance of a probability density function boils down to performing two specific integrations to find the necessary expected values and then using the fundamental variance formula.

Related Articles