Random Variable Simulation Techniques
Random Variable Simulation Techniques
1
uniform continuous between zero and one. That is, the density function of
probability is:
1
f ( x )= ,a>0 , b >0
( b−a)
2
Programming: the generation of random values can be useful
to test the effectiveness of an algorithm. They are also useful in
cryptology.
2.2 Simulation of other random variables.
Inverse transform method
It is the most direct method to generate a random variable. Let it be
F ( z ) ,a≤z≤b
A distribution function whose inverse distribution function is:
F −1 ( u ) ≔∈f
{z∈a,b:F
[ ] z≥u,0≤u≤1
( ) }
Let U be a random variable of
u ( 0,1 )
It is verified that
z=F−1 (U)
It has the distribution function F. The test follows from the observation of
what
prZ≤ [ F −1 (U ) ≤z]= pr [ U ≤ F(z) ]=F (z)
( z=) pr
This immediately suggests the following generation scheme:
Inverse Transform Method Algorithm
Purpose: Generate Z randomly from
F ( z) ≤
azb
Ability to evaluate
F −1 ( u ) ,0≤u≤1
Exit: Z
Method: Randomly generate U of
U ( 0,1 )
Z ← F −1 (U)
Devolver Z.
Example. The exponential distribution
Suppose you have an exponential distribution with mean beta. The
probability density function is:
3
The cumulative distribution function is:
Acceptance-rejection method
This method is more probabilistic than the previous one. Investment methods,
composition and convolution are direct generation methods, in the sense
they deal directly with the distribution function. The method of
acceptance-rejection is less direct in its approach.
This method will be applied in the case that the random variable is
continue, the discrete case is analogous and is addressed in Prob. 8.9
In this case, we have the density function f(x) of the variable y
we need a function f(x) that bounds it, that is, f(x) ≤ g(x). It should be noted
quet(x) is, in general, not a density function
4
So return if you do not repeat the algorithm again
The algorithm continues to repeat until a value is generated that is
accepted.
To minimize the number of points that are rejected, the function
t(x) must be the minimum function that bounds af(x).
Composition method
This method will be applicable when the density function is easy.
of
Being the number of pieces into which the function has been divided.
Each of the fragments can be expressed as a product of a
distribution function and a weight
In this method, it is necessary to generate random numbers (u1, u2,..., uk) for
generate (x1, x2,...xk) random variables using one of the methods
previous ones in order to obtain a value of the variable that is desired to be obtained
por convolución.
2.2.1 Theory: inverse transformation, convolution composition and others
procedures.
Inverse transform method
The inverse transform method can be used to simulate variables.
continuous random variables, which is achieved through the cumulative function f(x) and the
6
Define the density function f(x) that represents the variable a
to model.
Calculate the cumulative function f(x).
Clear the random variable x and obtain the cumulative function
inverse f(x)−1 .
7
Convolution method
The probability distribution of the sum of two or more random variables
independent is called the convolution of the distributions of the
original variables. The convolution method is then the sum of two or
more random variables to obtain a random variable with the
desired probability distribution. It can be used to obtain variables
with Erlang and binomial distributions
Methodology
Random numbers are generated (Y1, Y2, Y3…….Yn)
8
With one (or more depending on the method to be used) of the
random numbers, the component random variables are generated
(X1,X2,X3,…..Xn)
A value of the variable is obtained through linear summation of the
9
Generating pseudo-random numbers ri~U (0,1) applies the rule:
The rule for generating this random variable would be given by:
With the list of pseudo-random numbers r i~U (0,1) and the previous rule is
possible to simulate the daily demand for toothbrushes, as shown
10
Conclusion
In conclusion, we have that in the simulation, the random variables are
used in some jobs to calculate whether the work done
will it work or will it not work.
11