Normal random variables.
=============================
Continuous random variables
=============================
.. contents::
:local:
Probability density function
============================
.. role:: def
:class: def
:def:`Probability density function` (PDF) for continuous random variable
:math:`x` is function:
.. math::
PDF(a ≤ X ≤ b) = P(a ≤ X ≤ b) = ∫_{a, b}\ f_X(x) \ dx
f_X(x) ≥ 0
∫_{-∞, +∞}\ f_X(x) \ dx = 1
:math:`f_X(x)` funtion maps values :math:`x` from sample space to real numbers.
For continuous random variable:
.. math:: P(X = a) = 0
Expectation
===========
:def:`Expectation` of continuous random variable is:
.. math:: μ = E[X] = ∫_{-∞, +∞}\ x·f_X(x) \ dx
Properties:
.. math::
E[X + Y] = E[X] + E[Y]
E[a·X] = a·E[X]
E[a·X + b] = a·E[X] + b
Variance
========
:def:`Variance` of continuous random variable is:
.. math:: var[X] = ∫_{-∞, +∞}\ (x-μ)²·f_X(x) \ dx
Properties:
.. math::
var[a·X + b] = a²·var[X]
var[X] = E[X²] - E²[X]
Standard deviation
==================
:def:`Standard deviation` of continuous random variable is:
.. math:: σ_Χ = sqrt(var[X])
Cumulative distribution functions
=================================
:def:`Cumulative distribution functions` (CDF) of random variable :math:`X` is:
.. math:: F_X(x) = P(X ≤ x) = ∫_{-∞, x}\ f_X(t) \ dt
So:
.. math::
P(a ≤ X ≤ b) = F_X(b) - F_X(a) + f_X(a) = ∫_{a,b}\ f_X(x) \ dx
F_X(-∞) = 0
F_X(+∞) = 1
and :math:`F_X(a) ≤ F_X(b)` for :math:`a ≤ b`.
Relation between CDF and PDF:
.. math:: (d(CDF(t))/dt)(x) = PDF(x)
Conditional probability
=======================
:def:`Conditional probability` of continuous random variable is:
.. math:: P(X ⊆ B | A) = ∫_{B}\ f_{X|A}(x) \ dx = ∫_{A∩B}\ f_X(x) \ dx / P(A)
:def:`Conditional expectation` of continuous random variable is:
.. math:: E[X|A] = ∫_\ x·f_{X|A}(x) \ dx
Properties:
.. math::
E[g(X)|A] = ∫_\ g(x)·f_{X|A}(x) \ dx
Independence
============
Random variable :math:`X`, :math:`Y` are :def:`independent` if:
.. math:: f_{X,Y}(x, y) = f_X(x)·f_Y(y)
Continuous uniform random variable
==================================
:def:`Continuous uniform random variable` is :math:`f_X(x)` that is non-zero
only on :math:`[a, b]` with :math:`f_X(x) = `1/(b-a)`.
.. math::
E[unif(a, b)] = (b+a)/2
var[unif(a, b)] = (b-a)²/12
σ = (b-a)/sqrt(12)
Proofs:
.. math::
E[unif(a, b)] = ∫_{a, b}\ x·1/(b-a)·dx = x²/2/(b-a) |_{a, b} = (b²-a²)/(b-a)/2 = (b+a)/2
E[unif²(a, b)] = ∫_{a, b} x²·1/(b-a)·dx = x³/3/(b-a) |_{a, b} = (b³-a³)/(b-a)/3 = (b²+b·a+a²)/3
var[unif(a, b)] = E[unif²(a, b)] - E²[unif(a, b)] = (b²+b·a+a²)/3 - (b+a)²/4 = (b-a)²/12
.. note::
In maxima::
(%i4) factor((b^2+b*a+a^2)/3 - (a+b)^2/4);
2
(b - a)
--------
12
Exponential random variables
============================
:def:`Exponential random variables` with parameter :math:`λ` is:
.. math:: f_X(x) = λ·exp(-λ·x)
for :math:`x ≥ 0`, and zero otherwise.
Properties:
.. math::
E[exp(λ)] = 1/λ
var[exp(λ)] = 1/λ²
Proof:
.. math::
∫_{-∞, +∞}\ f_X(x) \ dx = ∫_{0, +∞}\ λ·exp(-λ·x) \ dx = -exp(-λ·x) |_{0, +∞} = 1
E[exp(λ)] = ∫_{0, +∞}\ x·λ·exp(-λ·x) \ dx = 1/λ
E[exp²(λ)] = ∫_{0, +∞}\ x²·λ·exp(-λ·x) \ dx = 1/λ²
.. note::
From maxima::
(%i15) assume(lambda>0);
(%o15) [lambda > 0]
(%i16) integrate(lambda*%e^(-lambda*x),x,0,inf);
(%o16) 1
(%i17) integrate(x*lambda*%e^(-lambda*x),x,0,inf);
1
(%o17) ------
lambda
(%i18) integrate(x^2*lambda*%e^(-lambda*x),x,0,inf);
2
(%o18) -------
2
lambda
Normal random variables
=======================
:def:`Normal random variables` with parameters :math:`μ, σ` and :math:`σ > 0`
defined by PDF:
.. math:: norm(μ, σ) = 1/σ/sqrt(2·π)·exp(-(x-μ)²/σ²/2)
Properties:
.. math::
E[norm(μ, σ)] = μ
var[norm(μ, σ)] = σ²
Disjoint distribution of two normal r.v.
========================================
.. math::
norm2(μ₁, μ₂, σ₁, σ₂) = norm(μ₁, σ₁)·norm(μ₂, σ₂)
= 1/(2·π·σ₁·σ₂)·exp(-(x-μ₁)²/σ₁²/2 - (x-μ₂)²/σ₂²/2)