A random variables is continuous if possible values comprise either a single interval on the number line or a union of disjoint intervals. More simply, a continuous random variable is a random variable that is not discrete.
The probability that a continuous random variable takes on any specific value is in fact 0. This gives us a bit of a paradox since when measuring a continuous random variable, you will get a single value however the probability of seeing exactly this value is in fact 0. What we can say is the probability that the variable is between an upper and lower bound (e.g., $P(a <= X <= b)$)
## Expectation
The expected value of a continuous random variable is given by
$E(X) = \int\limits^{\infty}_{-\infty}x * f(x) dx$
If $h(X)$ is any function of $X$, then $E(h(X)) = \int\limits^{\infty}_{-\infty}h(x) * f(x) dx$
## Variance
The variance of a continuous random variable is given by
$V(X) = E(X^2) - (E(X))^2$
Note this is the same as the calculation formula for the variance of a discrete random variable. The calculation of the second moment is:
$E(X^2) = \int_{-\infty}^{\infty}x^2 * f(x)dx$
## Probability Density Function
The Probability Density Function for a continuous random variable $X$ is notated as $f(x)$. Then, the probability of any range of values is the integral from $a$ to $b$ of $f(x)dx$.
$P(a<= X<= b) = \int_a^b f(x)dx$
Recall from calculus that the integral gives the area under the curve from $a$ to $b$, which given the PDF as the curve and the values $a$ and $b$ as the upper and lower bounds of interest, will return the probability of those values. #expand
A few additional properties of the PDF include:
- The probability density function of $f$: $(-\infty, \infty)$ -> $[0, \infty)$ so $f(x) >= 0$
- $P(-\infty < X < \infty) = \int\limits^{\infty}_{-\infty}f(x)dx = 1$
- $P(X=a) = \int_a^af(x)dx = 0$
## Cumulative Density Function
The cumulative distribution function (cdf) for a continuous random variable $X$ is given by
$F(X) = P(X <=x) = \int_{-\infty}^{x}f(t)dt$
The properties of the cdf include
- $0 <= F(x) <=1$
- The limit of $F(x)$ as $x$ approaches $-\infty$ is 0 and as $x$ approaches $\infty$ is 1.
- $F'(X) = f(x)$ by the Fundamental Theorem of Calculus
- $F(X)$ is a monotonically increasing function.