Chapter 5 Sampling in Discrete Even Simulation
Chapter 5 Sampling in Discrete Even Simulation
Sampling
Contents
• Fast review on probabilities and random variables
• Need for sampling
• Random number generation
• Pseudo random number
• Random variate generation: inverse transform
rejection and convolution
• Sampling from discrete distribution, binomial
distribution and Poisson distribution
• Sampling from continuous distribution negative
exponential distribution, uniform distribution and
normal distribution
Fast review on probabilities and random variables
• Probability
– Is measure of uncertainty in occurrence of
random phenomenon
• Occurrence of head or tail in a coin toss experiment
– Is measured on a continuous scale between [0,1]
– Quantifies any likelihood of occurrence
– Frequency ration in multiple experiments
• If n experiments are performed and out of them, in k
of the experiments, phenomena A has occurred then
k
P̂A
n
Sample space, sample points and event
• Sample points
– Each possible outcome of an experiment
• Sample space
– The set of all possible sample points
• Event
– A subset of sample space
• Example- 1) if we toss a coin 1000 times and collect the
outputs
– the 1000 outputs are known as sample points
– S={head, tail} is sample space
– A={Head} is a simple event
Statistical independence and conditional
probability
• Statistical independence
– Two random events are said to be statistically
independent if and only if
PA B PAPB
– Equivalently
PA PA PB PB
B A
• Conditional probability
PA
B
Is conditional probability which means probability of occurrence of event A
given B has occurred
• Conditional probability
– Definition
PX 3 1/ 2 PX 6 1
• The function
FX (x) P(X x) x
Is known as cumulative distribution function
Properties of CDF
• 1 0 FX x 1 where x
• 2 xlim FX x 0 and lim
x
F x 1
X
• 3 if x1<x2 then
F (x1 ) F (x 2 ) P x1 x x 2 F x 2 F x1
X X X X
Example 2. probability of arrival of sum of two numbers on
two faces of a dice
Probability of
occurrence of
number
CDF for the random
variable of the sum of
two numbers in
throwing two dice
Probability density function
marginal density
• Joint distribution is obtained as
• Independence
– If X and Y are two independent random variables
Moments
• Are expectations of powers of a random
variable
• Kth moment is defined as
• Important moments:
– K=2 defines variance and standard deviation
– K=3 defines skewness
– K=3 defines kurtosis
Moments cont…
• K=2, variance and standard deviation
– variance
– standard deviation
• Both are measures of variability
• But are not linear V aX bY aV(X) bV(Y)
• Example: calculate the second moment of the
two dice experiment
E X2 54.833
Hence variance V[X]=54.833-49=5.833
=(1/36)*((2-7)^2*1+(3-7)^2*2+(4-7)^2*3+(5-7)^2*4+
1*5+ 0*6 +1*5+4*4+9*3+16*2+25)=5.833
Moments cont…
• K=3, skewness – departure from symmetry
• The coefficient of skewness is given as
80.5
For the two dice example, the kurtosis becomes kX 4
3 0.63
5.833
Kurtosis is negative which means the distribution is less fat than
normal distribution of the same sd
Correlations
• Correlations measure how two random
variables X and Y defined over the same space
vary with respect to each other
• They give notion of their associations
• Correlation coefficient is given as
• Properties
– a)
– b) independent random variables are uncorrelated but the
converse is not true
Common discrete distributions
• 1. Generic discrete distribution
– It is denoted by
• Disc({(pi, vi): i=1,2…}) where each parameter pair (pi,vi)
corresponds to P{X=vi}=pi
• It can model or be used for simulation of various
situations having discrete outcomes
• The probability mass function of discrete distribution is
defined as
1
• Where l{v } ( x ) If x vi
i
0 otherwise
Bernoulli distribution
• A trial with two possible outcomes
– Success or failure, true or false
– Its state space is S={0, 1}
– Is denoted by Ber(p) where p is the probability of
success
– The probability mass function is given by
• It is denoted by B(n, p)
• The probability mass function is given by
• Exponential distribution
– Assumes values in the positive half line
– It models random inter arrival times in continuous
time, especially when they are iid
– Denoted by Expo( )
– being rate parameter
– The pdf and CDF are
• Objective:
– Given a probability distribution, generate random
number which conform to it
• Three problems
– Single variate generation – generate X from a
given distribution
– IId process generation- generate iid sequance of
variates {Xn} with common distribution
– Non iid process generation
Random variate generation: inverse transform
rejection and convolution
• Let X be the random variate to be generated
having pdf fX (x) and CDF FX (x)
• Solving for x x u (b a ) a