2 years ago

# Probability and Statistics

## Transformations

Let $X$ be a random variable defined on probability space $(\Omega,\mathscr{F},P)$, with probability distribution $P^X$, and we are often interested in a random variable $Y$ which is some transformation of $X$, say $Y=g(X)$, then $Y$ will be another random variable on $(\Omega,\mathscr{F},P)$

Note: Technically $g:\mathbb{R}\to\mathbb{R}$ should be Borel measurable function so that $Y=g(X)$ will be again a random variable on $(\Omega,\mathscr{F},P)$
(A function $f:\mathbb{R}\to\mathbb{R}$ is said to be Borel measurable function if $f^{-1}(B)\in\mathscr{B}~\forall B\in\mathscr{B}$)

import numpy as np
from matplotlib import patches
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.subplots()

Omega = patches.Ellipse((0.14, 0.5), 0.2, 0.5,
angle=0, linewidth=2, fill=False, zorder=2,color='purple')

XR = patches.Rectangle((0.4, 0.25), 0.2, 0.5,
angle=0, linewidth=2, fill=False, zorder=2,color='blue')

gR = patches.Rectangle((0.75, 0.25), 0.2, 0.5,
angle=0, linewidth=2, fill=False, zorder=2,color='red')

ax.text(0.1,0.8,r"$\Omega$",fontsize=15)
ax.text(0.45,0.8,r"$\mathbb{R}$",fontsize=15)
ax.text(0.8,0.8,r"$\mathbb{R}$",fontsize=15)

ax.arrow(0.15,0.82,0.25,0,width=0.005,color='navy')
ax.arrow(0.5,0.82,0.25,0,width=0.005,color='green')
ax.text(0.23,0.85,r"$X$",fontsize=15)
ax.text(0.63,0.85,r"$g$",fontsize=15)

ax.arrow(0.13,0.55,0.30,0,width=0.003,color='black')
ax.arrow(0.56,0.55,0.26,0,width=0.003,color='black')
ax.text(0.09,0.55,r"$\omega$",fontsize=15)
ax.text(0.47,0.55,r"$x$",fontsize=15)
ax.text(0.85,0.55,r"$y$",fontsize=15)
plt.axis('off')
plt.show()