---
title: "Expectation"
author:
  - name: "Fan Wang"
    affiliation: "Department of Economics, University of Houston"
    url: "https://fanwangecon.github.io/"
date: "2026-11-30"
---

**Part of [Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics](https://fanwangecon.github.io/Stam4Econ/).**  
[Main Stam4Econ site](https://fanwangecon.github.io/Stam4Econ/) | [View this section in the book](https://fanwangecon.github.io/Stam4Econ/stats_expectation/overview.html#expectation) | [Author: Fan Wang](https://fanwangecon.github.io/) | [DOI: 10.5281/zenodo.24696926](https://doi.org/10.5281/zenodo.24696926)  
Date: 2026-11-30 | [HTML](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/stats_expectation/expectation.html) | [PDF](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/stats_expectation/expectation.pdf) | [QMD](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/stats_expectation/expectation.qmd)

## Expectation

### Expectation of a discrete random variable

The expectation (or expected value, or mean) of a discrete random variable $X$ is defined as:

$$
E(X) = \sum_{x_i \in \text{Support of } X} x_i P(X = x_i)
$$

where $P(X = x_i)$ is the probability that the random variable $X$ takes on the value $x_i$.

### Expectation of a continuous random variable

The expectation (or expected value, or mean) of a continuous random variable $X$ is defined as:

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

where $f_X(x)$ is the probability density function of the random variable $X$.

### Expectation of a transformation of a random variable

We have random variable $X$ and density $f(x)$, and we define a new random variable $Y = g(X)$, where $g$ is some function. Then the expectation of $Y$ is:

$$
E(Y) = E(g(X)) = \int_{-\infty}^{\infty} g(x) f_X(x) dx
$$

So if $Y = g(X) = aX + b$, then

$$
E(Y) = E(aX + b) = \int_{-\infty}^{\infty} (ax + b) f_X(x) dx = a \int_{-\infty}^{\infty} x f_X(x) dx + b \int_{-\infty}^{\infty} f_X(x) dx = aE(X) + b
$$

Note that expectation is a linear operator.
