\renewcommand{\coddate}{{\small \today}}
\renewcommand{\sheweek}{2. Random Variables and their Distributions}

%-------------------------------------------------------------
%
\section{Random Variables and their Distributions}
%

%**********
\subsection{Random Variables}
%**********
%
A random variable is a function $X: \Omega \longrightarrow \R$
with the property that, if $A_x = \{ \omega \in \Omega: X(\omega)
\leq x\}$ then $A_x \in {\cal F}$ for all $x \in \R$. Thus, $A_x$
is an event, for every real-valued $x$.

\begin{enumerate}
\item \textbf{(Cumulative) distribution function}: of a random
variable $X$ is the function $F: \R \longrightarrow [0,1]$ given
by $F(x) = P(X \leq x)$.

\item \textbf{Properties of distribution functions}
\begin{enumerate}
\item Limits: $\lim_{x \rightarrow - \infty} F(x) = 0$ and
              $\lim_{x \rightarrow \infty} F(x) = 1$.
\item Non-decreasing: if $x<y$ then $F(x) \leq F(y)$.
\item Right continuous: $\lim_{h \downarrow 0} F(x+h) = F(x)$.
\end{enumerate}

\item \textbf{Probabilities from distribution functions}
\begin{enumerate}
\item $P(X>x) = 1 - F(x)$.
\item $P(x < X \leq y) = F(y) - F(x)$.
\item $P(X<x) = \lim_{h \downarrow 0} F(x-h) = F(x-)$.
\item $P(X=x) = F(x) - F(x-)$.
\end{enumerate}
\end{enumerate}


%**********
\subsection{Discrete Random Variables}
%**********
%

A random variable $X$ is \textit{discrete} if it only takes values
in some countable subset $\{x_1, x_2, \ldots\}$ of $\R$.

\begin{enumerate}
\item \textbf{Probability mass function}: of a discrete random variable X
is the function $f: \R \longrightarrow [0,1]$ given by $f(x) =
P(X=x)$.

\item \textbf{Properties of mass functions}
\begin{enumerate}
\item $f(x) = F(x) - F(x-)$.
\item $\sum_{i:x_i \leq x} f(x_i) = F(x)$.
\item $\sum_i f(x_i) = 1$.
\item $f(x) = 0$ if $x \notin \{x_1,x_2,\ldots\}$.
\end{enumerate}
\end{enumerate}

%**********
\subsection{Continuous Random Variables}
%**********
%
A random variable $X$ is \textit{continuous} if its distribution
function can be expressed as
$$
F(x) = \int_{-\infty}^x f(u)du \qquad {\rm for} \  x \in \R,
$$
for some integrable function $f: \R \longrightarrow [0, \infty)$.
The function $f$ is called the \textbf{(probability) density
function} of $X$.

\newpage
\begin{enumerate}
\item \textbf{Properties of continuous random variables}
\begin{enumerate}
\item $P(X = x) = 0$ for all $x \in \R$.
\item $\int_{-\infty}^{\infty} f(x) dx = 1$.
\item $\int_a^b f(x) dx = P(a< X \leq b)$.
\end{enumerate}

\item \textbf{Unified notation}: known as Lebesgue-Stieltjes integral.
For a random variable $X$;
$$
P(a < X \leq b) = \int_a^b dF(x) = \left\{ \begin{array}{ll}
\sum_{i:a< x_i \leq b} f(x_i), & {\rm if} \ X \ {\rm discrete}, \\
\int_a^b f(x) dx, & {\rm if} \ X \ {\rm continuous}.
\end{array} \right.
$$
\end{enumerate}

%**********
\subsection{Support and indicator functions}
%**********
%
\begin{enumerate}
\item \textbf{Support}: The support of a non-negative real-valued
function $f$ is the subset of $\R$ on which $f$ takes non-zero
values, that is, $\{x \in \R: f(x) >0 \}$.

\item \textbf{Indicator function}: The indicator function for
a set $S \subset \R$ is $I_S(x)$ where
$$
I_S(x) = \left\{ \begin{array}{ll} 1, & x \in S \\
0, & \text{otherwise}.
\end{array} \right.
$$
The set $S$ often takes the form of an interval such as $[0,1]$ or
$[0,\infty)$.
\end{enumerate}

%**********
\subsection{Mean}
%**********
%
If $X$ is a random variable with $\int_{-\infty}^{\infty} |x|
dF(x) < \infty$, the mean of $X$ is defined as
$$
\mu = E(X) = \int_{-\infty}^{\infty} x dF(x) = \left\{
\begin{array}{ll}
\sum_i x_i f(x_i), & {\rm if} \ X \ {\rm discrete}, \\
\int_{-\infty}^{\infty} x f(x) dx, & {\rm if} \ X \ {\rm
continuous}.
\end{array} \right.
$$

%**********
\subsection{Variance}
%**********
%
If $X$ is a random variable, the variance of $X$ is defined as
$$
\sigma^2 = \var(X) = \int_{-\infty}^{\infty} (x - \mu)^2 dF(x) =
\left\{
\begin{array}{ll}
\sum_i (x_i - \mu)^2 f(x_i), & {\rm if} \ X \ {\rm discrete}, \\
\int_{-\infty}^{\infty} (x - \mu)^2 f(x) dx, & {\rm if} \ X \ {\rm
continuous}.
\end{array} \right.
$$
The standard deviation is defined as $\sigma = \sqrt{\var(X)}$.

%**********
\subsection{Expectation operator}
%**********
%
For any function $g: \R \longrightarrow \R$, with
$\int_{-\infty}^{\infty} |g(x)|dF(x) < \infty$, the
\textit{expectation}, or \textit{expected value} of $g(X)$ is defined
as
$$
E[g(X)] = \int_{-\infty}^{\infty} g(x) dF(x) = \left\{
\begin{array}{ll}
\sum_i g(x_i) f(x_i), & {\rm if} \ X \ {\rm discrete}, \\
\int_{-\infty}^{\infty} g(x) f(x) dx, & {\rm if} \ X \ {\rm
continuous}.
\end{array} \right.
$$
\newpage
\begin{enumerate}
\item \textbf{Properties of expectation}: for constant $a$ and random
variables $X$ and $Y$ with defined expected values.
\begin{enumerate}
\item $E(a) = a$.
\item $E(aX) = a E(X)$.
\item $E(X+Y) = E(X) + E(Y)$.
\item If $X \geq Y$ then $E(X) \geq E(Y)$.
\end{enumerate}

\item \textbf{Inequalities involving expectation}
\begin{enumerate}
\item Markov inequality: Let $Y$ be a random variable with $Y \geq 0$
and $E(Y)$ defined, then $P(Y \geq a) \leq E(Y)/a$ for any constant $a
> 0$. \item Chebyshev inequality: Let $X$ be a random variable with E(X)
defined, then $P(|X- E(X)| \geq a ) \leq \sigma^2 / a^2$ for any
constant $a
> 0$.
\item Jensen inequality: If $X$ is a random variable with
$E(X)$ defined and $g$ is a convex function with $E(g(X))$
defined, then $E(g(X)) \geq g(E(X))$.
\end{enumerate}
\end{enumerate}

%**********
\subsection{Moments}
%**********
%

 If $r$ is a positive integer then the
$r^{{th}}$ \textit{moment}, $m_r$, of $X$ is
$$
m_r  = E(X^r).
$$
The $r^{{th}}$ \textit{central moment}, $\mu_r$ is
$$
\mu_r = E((X-m_1)^r).
$$
\begin{enumerate}
\item \textbf{Properties of moments}
\begin{enumerate}
\item $m_1 = E(X) = \mu$ (mean); $\mu_1 = 0$.
\item $\mu_2 = E(X^2) - E(X)^2 = \var(X) = \sigma^2$ (variance).
\item Coefficient of skewness: $\gamma_1 = E[(X- \mu)^3]/
\sigma ^3 = \mu_3 / \mu_2^{\frac{3}{2}}$.
\item Coefficient of kurtosis: $\gamma_2 = (E[(X- \mu)^4]/
\sigma^4) - 3 = (\mu_4 / \mu_2^2) - 3$.
\end{enumerate}

\item \textbf{Moment generating function}: of a random
variable $X$ is a function $M : \R \longrightarrow [0,\infty)$
given by
$$
M(t) = E(e^{tX}),
$$
where $M(t) < \infty$ for $|t| < h$ and some $h>0$.
\begin{enumerate}
\item Evaluation via integration:
$$
M(t) = \int_{-\infty}^{\infty} e^{tx} dF(x) = \left\{
\begin{array}{ll}
\sum_i e^{t x_i} f(x_i), & {\rm if} \ X \ {\rm discrete}, \\
\int_{-\infty}^{\infty} e^{t x} f(x) dx, & {\rm if} \ X \ {\rm
continuous}.
\end{array} \right.
$$

\item Taylor expansion:
$$
M(t) = 1 + t E(X) + \frac{t^2}{2!} E(X^2)+ \ldots + \frac{t^r}{r!}
E(X^r)+ \ldots = \sum_{j=0}^{\infty} \frac{E(X^j)}{j!} t^j.
$$

\item Derivatives at zero:
$$
M^{(r)}(0) = \left. \frac{d^r}{dt^r} M(t) \right|_{t=0} = E(X^r) =
m_r.
$$

\item Uniqueness: If $M_X(t) = M_Y(t)$ for all $|t| < h$ and some $h>0$,
then $F_X(x) = F_Y(x)$ for all $x \in \R$.
\end{enumerate}

\item \textbf{Cumulant generating function}: of a random
variable $X$ with moment generating function $M(t)$, is defined as
$$
K(t) = \log M(t),
$$
The $r^{th}$ \textit{cumulant}, $\kappa_r$, is the coefficient of
$t^r/r!$ in the expansion of the cumulant generating function
$K(t)$;
$$
\kappa_r = K^{(r)}(0) = \left. \frac{d^r}{dt^r} K(t)
\right|_{t=0}.
$$
\begin{enumerate}
\item $\kappa_1 = m_1 = \mu$ (mean, first moment).
\item $\kappa_2 = \mu_2 = \sigma^2$ (variance, second central
moment).
\item $\kappa_3 = \mu_3$ (third central moment).
\item $\kappa_4 + 3 \kappa_2^2 = \mu_4$ (forth central moment).
\end{enumerate}


\item \textbf{Probability generating function}: of a discrete
random variable $X$, taking non-negative integer values, is
defined as
$$
G(t) = E(t^X) = \sum_{i=0}^{\infty} t^i P(X=i).
$$
\begin{enumerate}
\item $P(X=0) = G(0)$.
\item $E(X) = G'(1)$.
\item $E(X(X-1)\ldots(X-k+1)) = G^{(k)}(1)$.
\end{enumerate}

\item \textbf{Characteristic function}: of a random variable $X$
is the function $\phi : \R \longrightarrow \C$ defined by
$$
\phi (t) = E(e^{i t X})
$$
where $i = \sqrt{-1}$. Note that $E(X^k) = i^{-k} \phi^{(k)}(0)$.
\end{enumerate}

\subsection{Functions of random variables} If $X$ is a random
variable with distribution function $F_X$ and $g$ is a real-valued
function, then $Y = g(X)$ is a random variable.
\begin{itemize}
\item If $g$ is strictly increasing $F_Y(y) = F_X(g^{-1}(y))$.
\item If $g$ is strictly decreasing $F_Y(y) = 1-F_X(g^{-1}(y))$.
\end{itemize}
