To calculate the variance of a probability distribution, you determine the expected deviation of each possible value from the expected value (mean) of the distribution, weighted by its probability. This process differs slightly between discrete and continuous probability distributions, but the underlying principle remains the same.
Discrete Probability Distribution
Here's how to calculate the variance (σ2) of a discrete probability distribution:
-
Calculate the Expected Value (Mean), μ: Multiply each possible value (xi) by its probability (P(xi)) and sum the results.
μ = Σ [xi * P(xi)]
-
Calculate the Deviation from the Mean: For each value (xi), subtract the mean (μ) to find the deviation: (xi - μ).
-
Square the Deviations: Square each deviation calculated in the previous step: (xi - μ)2.
-
Multiply by Probability: Multiply each squared deviation by its corresponding probability: (xi - μ)2 * P(xi).
-
Sum the Products: Sum all the products calculated in the previous step. This sum is the variance (σ2).
σ2 = Σ [(xi - μ)2 * P(xi)]
Example:
Value (xi) | Probability (P(xi)) |
---|---|
1 | 0.2 |
2 | 0.3 |
3 | 0.4 |
4 | 0.1 |
-
μ = (1 0.2) + (2 0.3) + (3 0.4) + (4 0.1) = 0.2 + 0.6 + 1.2 + 0.4 = 2.4
-
Deviations: (1-2.4) = -1.4, (2-2.4) = -0.4, (3-2.4) = 0.6, (4-2.4) = 1.6
-
Squared Deviations: (-1.4)2 = 1.96, (-0.4)2 = 0.16, (0.6)2 = 0.36, (1.6)2 = 2.56
-
Multiply by Probability: (1.96 0.2) = 0.392, (0.16 0.3) = 0.048, (0.36 0.4) = 0.144, (2.56 0.1) = 0.256
-
σ2 = 0.392 + 0.048 + 0.144 + 0.256 = 0.84
Therefore, the variance of this discrete probability distribution is 0.84.
Continuous Probability Distribution
For a continuous probability distribution with probability density function f(x), the variance (σ2) is calculated as:
-
Calculate the Expected Value (Mean), μ:
μ = ∫ x * f(x) dx (integrated over the entire range of x)
-
Calculate the Variance:
σ2 = ∫ (x - μ)2 * f(x) dx (integrated over the entire range of x)
Note: The standard deviation (σ) is the square root of the variance (σ2). σ = √σ2. The standard deviation provides a measure of the spread of the distribution in the same units as the random variable.