# HG changeset patch # User Oleksandr Gavenko # Date 1458129604 -7200 # Node ID 5d6cec5fe095f5c289fc193d37cfa8d8fb7fdd33 # Parent 3b9b5823948c64d49597b49de79ec8a0730a7739 Probability density function. Continuous uniform random variable. Exponential random variables. Cumulative distribution functions. diff -r 3b9b5823948c -r 5d6cec5fe095 probability-continuous.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/probability-continuous.rst Wed Mar 16 14:00:04 2016 +0200 @@ -0,0 +1,158 @@ + +============================= + 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]) + + +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 + +Cumulative distribution functions +================================= + +:def:`Cumulative distribution functions` of random variable :math:`X` is: + +.. math:: F_X(x) = P(X ≤ x) = ∫_{-∞, x} f_X(t)·dt