Professional Documents
Culture Documents
RANDOM NUMBERS
- Throwing a die: Integer between 1 and 6.
- Sum of throwing two dice: Integer between 2 and
12.
- The weight of a person: Real number larger than 0.
1 2
NOTATION NOTATION
Random variables Probability distribution
Upper-case Latin letter, for example X, Y, Z. Latin f in lower or upper case (depending on
Sometimes more than one letter is used (for interpretation) and an index showing the corre-
example NI in the Ice-cream Company). sponding symbol of the random variable.
Observation (outcome) of a random variable • Density function: fX, fY, fZ.
Lower-case counterpart of the symbol of the • Distribution function: FX, FY, FZ.
corresponding random variable, for example x, The index makes it easier to differentiate the
probability distributions when one is dealing with
y, z. more than one random variable.
Can sometimes be indexed to differentiate
observations, for example xi, yi, zi.
3 4
NOTATION NOTATION
Statistical properties of a probability distribution Estimates
Lower-case greek letter and an index showing Latin counterpart of the greek symbol that is
the corresponding symbol of the random estimated. Can be upper-case or lower-case
variable: depending on interpretation.
• Expectation value (mean): X , Y , Z . • Estimated expectation value: mX, mY, mZ.
• Standard deviation: X, Y, Z. • Estimated standard deviation: sX, sY, sZ.
5 6
7 8
RANDOM VARIABLES RANDOM VARIABLES
- Frequency function - Density Function
Definition 1: The probability of the The probability that the outcome is exactly x is
outcome x for a univariate discrete infinitesimal for a continuous random variable.
Therefore, we use a density function to represent
random variable X is given by the the probability that the outcome is approximately
frequency function fXx, i.e., equal to x.
P(X x) = fXx. Definition 2: The probability of the
outcomes X for a univariate continuous
random variable X is given by the density
function fXx, i.e.,
P(X X) = f X x dx.
X
9 10
11 12
RANDOM VARIABLES RANDOM VARIABLES - Density,
- Distribution Function frequency and distribution functions
Lemma: The relation between distri-
Lemma: A distribution function has the
bution functions and frequency/density
following properties:
functions can be written as
• lim F X x = 0. x x
x –
FX x = f X or F X x = f X d .
• lim F X x = 1.
x + = – –
• x1 < x2 FX(x1) < FX(x2). (Increasing)
• lim F X x + h = F X x . (Right-continuous)
h0
+
13 14
15 16
POPULATIONS EXAMPLE 2 - Discrete r.v.
• The population X has the units x 1, …, x N, i.e., Let X be the result of throwing a fair six-sided
X is a set with N elements. die once.
• It is possible that N is infinite. a) State the frequency function fX(x).
• A random observation of X is equivalent to b) State the distribution function FX(x).
randomly selecting a unit from the population c) Enumerate the population X.
X.
• The probability of selecting a particular unit is
1/N. Hence,
N x X: x x
i i
FX(x) = ---------------------------------- . (1)
N
17 18
19 20
EXAMPLE 2 - Discrete r.v. EXAMPLE 3 - Continuous r.v.
Solution (cont.) Let X be a random variable which is uniformly
distributed between 10 and 20.
c) X = {1, 2, 3, 4, 5, 6}.
a) State the frequency function fX(x).
1 5 b) State the distribution function FX(x).
2 3 c) Enumerate the population X.
4 6
21 22
x x
5 10 15 20 25 30 5 10 15 20 25 30
0. 1 10 x 20, 0 x 10,
fX(x) =
0 all other x. FX(x) = 0. 1 x – 1 10 x 20,
1 20 x.
23 24
EXAMPLE 3 - Continuous r.v. EXPECTATION VALUE
Solution (cont.) The expectation value of a random variable is
c) The population has one unit for each real the mean of the all possible outcomes weighted
number between 10 and 20. according to their probability:
Definition 4: The expectation value of the
random variable X is given by
E X = xf X x (discrete),
x = –
25 26
27 28
VARIANCE VARIANCE
The expectation value provided important infor- A common measure of the spread is the
mation about a random variable, but in many variance, i.e., the expected quadratic deviation
cases we need to know more than the expected from the expectation value.
average, for example the spread.
Definition 5: The variance of the random
fX fX
variable X is given by
Var X = E X – E X 2
E X 2 – E X 2 (general),
x x
2
Var X = x – EX fX x
x = – (discrete),
29 30
31 32
COVARIANCE COVARIANCE
For multivariate distributions it is sometimes A covariance matrix, X, states the covariance
necessary to describe how the random variables between all random variables in a multivariate
interact: distribution:
Definition 7: The covariance of two X =
random variables X and Y is given by
Var X 1 Cov X 1 X 2 … Cov X 1 X k
Cov X Y = E X – E X Y – E Y =
= E XY – E X E Y . Cov X 2 X 1 Var X 2
=
…
Cov X Y = Cov Y X ,
…
Lemma:
Cov X X = Var X . Cov X k X 1 Var X k
33 34
35 36
INDEPENDENT RANDOM INDEPENDENT RANDOM
VARIABLES VARIABLES
A very important special case when studying Theorem 1: If X and Y are independent
multivariate distributions is when the random then
variables are independent.
E[XY] = E[X]E[Y].
Definition 9: X and Y are independent
Theorem 2: If X and Y are independent
random variables if it holds for each x and
then they are also uncorrelated.
y that
fX, Y(x, y) = fX(x)fY(y) FX, Y(x, y) = FX(x)FY(y). Warning! Correlations are easily misunderstood!
37 38
39 40
ARITHMETICAL OPERATIONS ARITHMETICAL OPERATIONS
Theorem 3 (cont.) Theorem 3 (cont.)
iii) E[X + Y] = E[X] + E[Y] N
1
E g X Y = ---- g x i y i
N
iv) E g X Y = g x y f XY x y dx dy i=1
(population)
– –
(continuous), Theorem 4:
E g X Y = g x y f XY x y i) Var aX = a 2 Var X
x y
(discrete). ii) Var X + Y =
= Var X + Var Y + 2Cov X Y
41 42
43 44
PROBABILITY DISTRIBUTIONS RANDOM NUMBERS
• Probability distributions can be defined • A random number generator is necessary to
arbitrarily, but there are also general proba- create random samples for a computer
bility distributions which appear in many simulation.
practical applications. • A random number generator is a mathe-
• Density function, distribution functions, matical function that generate a sequence of
expectation values and variances for many numbers.
general probability distributions can be found
in mathematical handbooks. The English
version of Wikipedia also provides a lot of
information.
45 46
47 48
RANDOM NUMBERS RANDOM NUMBERS
• The designation pseudo-random numbers is A good random number generator will generate
sometimes used to stress that the sequence a sequence of random numbers which
of numbers is actually deterministic. • is as long as possible (before it repeats itself)
• One method to make it more or less impos- • is distributed as close to a U(0, 1)-distribution
sible to predict a sequence of pseudo-random as possible
numbers it to use the internal clock of the
• has a negligible correlation between the
computer as seed.
numbers in the sequence.
• An advantage of pseudo-random numbers is
that a simulation can be recreated by using
the same seed again.
49 50
53 54
Y = F Y– 1 0. 4 = 14.
* This method is therefore referred to as the “ap-
proximative inverse transform method”.
55 56
NORMALLY DISTRIBUTED NORMALLY DISTRIBUTED
RANDOM NUMBERS RANDOM NUMBERS
Theorem 7 (cont.) Theorem 7 (cont.)
U if U , c0 + c1 t + c2 t2
Q= z=t– --------------------------------------------------
1 – U if U , 1 + d1 t + d2 t2 + d3 t 3
c0=2.515 517, d1 = 1.432 788,
t – 2 ln Q ,
c1=0.802 853, d2 = 0.189 269,
c2=0.010 328, d3 = 0.001 308,
57 58
59 60
CORRELATED RANDOM CORRELATED RANDOM
NUMBERS - Normal distribution NUMBERS - Normal distribution
Theorem 8: Let X = [X1, …, XK]T be a vec- Theorem 8 (cont.)
tor of independent N(0, 1)-distributed
components. Let B =1/2, i.e., let i and B = P1/2PT.
gi be the i:th eigenvalue and the i:th Then Y = + BX is a random vector where
eigenvector of and define the following the elements are normally distributed
matrices: with the mean and the covariance ma-
P = [g1, …, gK], trix .
= diag(1, …, K),
61 62
63 64
CORRELATED RANDOM CORRELATED RANDOM
NUMBERS - Alternative method NUMBERS - Alternative method
• This method is only applicable to discrete Original distribution function: FY1, Y2y1, y2is the
probability distributions. probability that Y1 y1 and Y2 y2.
However, a continuous probability distribution
Modified distribution function: Arrange all units
can of course be approximated by a discrete
distribution. in the population in an ordered list; FY1, Y2n is
now the probability to select one of the n first
• The idea is to use a modified distribution
units in the list.
function for the inverse transform method.
The order of the list might influence the efficiency
of some variance reduction techniques!
65 66
67 68
EXAMPLE 5 - Correlated discrete EXAMPLE 5 - Correlated discrete
random numbers random numbers
Solution: a) The probability y2 Solution (cont.) The condi- y2
distribution of the first tional distribution of Y1 is now
element is given by given by
f Y1 y 1 = f Y1 Y2 y 1 2 f Y1 Y2 1 y 2
Y 1 = 1 y 2
f Y2 -------------------------------
2 y1 f Y1 1 y1
0. 2 y 1 = 1,
0. 5 y 2 = 1,
= 0. 35 y 1 = 2, Y1 = F Y1
– 1 0. 15 = 1.
= 0. 25 y 2 = 2, Y2 = F Y2
–1
Y 1 = 1 0. 62 = 2.
45 y 1 = 3.
0. 25 y 2 = 3.
69 70
71 72