Random Variable Reference
Discrete Random Variables
Bernoulli Random Variable
Notation: | $X \sim \Ber(p)$ |
---|---|
Description: | A boolean variable that is 1 with probability $p$ |
Parameters: | $p$, the probability that $X=1$. |
Support: | $x$ is either 0 or 1 |
PMF equation: | $\p(X=x) = \begin{cases} p && \text{if }x = 1\\ 1-p && \text{if }x = 0 \end{cases}$ |
PMF (smooth): | $\p(X=x) = p^x(1-p)^{1-x}$ |
Expectation: | $\E[X] = p$ |
Variance: | $\var(X) = p (1-p)$ |
PMF graph: |
Binomial Random Variable
Notation: | $X \sim \Bin(n, p)$ |
---|---|
Description: | Number of "successes" in $n$ identical, independent experiments each with probability of success $p$. |
Parameters: | $n \in \{0, 1, \dots\}$, the number of experiments. $p \in [0, 1]$, the probability that a single experiment gives a "success". |
Support: | $x \in \{0, 1, \dots, n\}$ |
PMF equation: | $$\p(X=x) = {n \choose x}p^x(1-p)^{n-x}$$ |
Expectation: | $\E[X] = n \cdot p$ |
Variance: | $\var(X) = n \cdot p \cdot (1-p)$ |
PMF graph: |
Parameter $n$:
Parameter $p$:
Poisson Random Variable
Notation: | $X \sim \Poi(\lambda)$ |
---|---|
Description: | Number of events in a fixed time frame if (a) the events occur with a constant mean rate and (b) they occur independently of time since last event. |
Parameters: | $\lambda \in \mathbb{R}^{+}$, the constant average rate. |
Support: | $x \in \{0, 1, \dots\}$ |
PMF equation: | $$\p(X=x) = \frac{\lambda^xe^{-\lambda}}{x!}$$ |
Expectation: | $\E[X] = \lambda$ |
Variance: | $\var(X) = \lambda$ |
PMF graph: |
Parameter $\lambda$:
Geometric Random Variable
Notation: | $X \sim \Geo(p)$ |
---|---|
Description: | Number of experiments until a success. Assumes independent experiments each with probability of success $p$. |
Parameters: | $p \in [0, 1]$, the probability that a single experiment gives a "success". |
Support: | $x \in \{1, \dots, \infty\}$ |
PMF equation: | $$\p(X=x) = (1-p)^{x-1} p$$ |
Expectation: | $\E[X] = \frac{1}{p}$ |
Variance: | $\var(X) = \frac{1-p}{p^2}$ |
PMF graph: |
Parameter $p$:
Negative Binomial Random Variable
Notation: | $X \sim \NegBin(r, p)$ |
---|---|
Description: | Number of experiments until $r$ successes. Assumes each experiment is independent with probability of success $p$. |
Parameters: | $r > 0$, the number of success we are waiting for. $p \in [0, 1]$, the probability that a single experiment gives a "success". |
Support: | $x \in \{r, \dots, \infty\}$ |
PMF equation: | $$\p(X=x) = {x - 1 \choose r - 1}p^r(1-p)^{x-r}$$ |
Expectation: | $\E[X] = \frac{r}{p}$ |
Variance: | $\var(X) = \frac{r \cdot (1-p)}{p^2}$ |
PMF graph: |
Parameter $r$:
Parameter $p$:
Continuous Random Variables
Uniform Random Variable
Notation: | $X \sim \Uni(\alpha, \beta)$ |
---|---|
Description: | A continuous random variable that takes on values, with equal likelihood, between $\alpha$ and $\beta$ |
Parameters: | $\alpha \in \R$, the minimum value of the variable. $\beta \in \R$, $\beta > \alpha$, the maximum value of the variable. |
Support: | $x \in [\alpha, \beta]$ |
PDF equation: | $$f(x) = \begin{cases} \frac{1}{\beta - \alpha} && \text{for }x \in [\alpha, \beta]\\ 0 && \text{else} \end{cases}$$ |
CDF equation: | $$F(x) = \begin{cases} \frac{x - \alpha}{\beta - \alpha} && \text{for }x \in [\alpha, \beta]\\ 0 && \text{for } x < \alpha \\ 1 && \text{for } x > \beta \end{cases}$$ |
Expectation: | $\E[X] = \frac{1}{2}(\alpha + \beta)$ |
Variance: | $\var(X) = \frac{1}{12}(\beta - \alpha)^2$ |
PDF graph: |
Parameter $\alpha$:
Parameter $\beta$:
Exponential Random Variable
Notation: | $X \sim \Exp(\lambda)$ |
---|---|
Description: | Time until next events if (a) the events occur with a constant mean rate and (b) they occur independently of time since last event. |
Parameters: | $\lambda \in \mathbb{R}^{+}$, the constant average rate. |
Support: | $x \in \mathbb{R}^+$ |
PDF equation: | $$f(x) = \lambda e^{-\lambda x}$$ |
CDF equation: | $$F(x) = 1 - e^{-\lambda x}$$ |
Expectation: | $\E[X] = 1/\lambda$ |
Variance: | $\var(X) = 1/\lambda^2$ |
PDF graph: |
Parameter $\lambda$:
Normal (aka Gaussian) Random Variable
Notation: | $X \sim \N(\mu, \sigma^2)$ |
---|---|
Description: | A common, naturally occurring distribution. |
Parameters: | $\mu \in \mathbb{R}$, the mean. $\sigma^2 \in \mathbb{R}$, the variance. |
Support: | $x \in \mathbb{R}$ |
PDF equation: | $$f(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{-\frac{1}{2}\Big(\frac{x-\mu}{\sigma}\Big)^2}$$ |
CDF equation: | $$\begin{align} F(x) &= \phi(\frac{x-\mu}{\sigma}) && \text{Where $\phi$ is the CDF of the standard normal} \end{align}$$ |
Expectation: | $\E[X] = \mu$ |
Variance: | $\var(X) = \sigma^2$ |
PDF graph: |
Parameter $\mu$:
Parameter $\sigma$:
Beta Random Variable
Notation: | $X \sim \Beta(a, b)$ |
---|---|
Description: | A belief distribution over the value of a probability $p$ from a Binomial distribution after observing $a-1$ successes and $b- 1$ fails. |
Parameters: | $a > 0$, the number successes + 1 $b > 0$, the number of fails + 1 |
Support: | $x \in [0, 1]$ |
PDF equation: | $f(x) = B(a,b) \cdot x^{a-1} \cdot (1-x)^{b-1}$ where $B(a,b) = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a,b)}$ |
CDF equation: | No closed form |
Expectation: | $\E[X] = \frac{a}{a+b}$ |
Variance: | $\var(X) = \frac{ab}{(a+b)^2(a+b+1)}$ |
PDF graph: |
Parameter $a$:
Parameter $b$: