0% found this document useful (0 votes)
8 views11 pages

Random Variable Simulation Techniques

The document describes several methods for generating random variables in simulations, including the inverse transform method, the composition method, and the convolution method. It explains that these methods use random numbers to simulate stochastic processes and variables that follow specific probability distributions. It also discusses applications such as Monte Carlo simulation and statistical sampling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views11 pages

Random Variable Simulation Techniques

The document describes several methods for generating random variables in simulations, including the inverse transform method, the composition method, and the convolution method. It explains that these methods use random numbers to simulate stochastic processes and variables that follow specific probability distributions. It also discusses applications such as Monte Carlo simulation and statistical sampling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction

The simulation of variables in this subject is of utmost importance because


due to the simulation of various variables we will be able to make calculations for

some simulation jobs.


Examples of this topic are the random variables that can be useful to us.
for calculations of various simulations used in manipulation of
professional jobs down to the simplest ones.
2.1 Production of numbers with random statistical behavior and
uniform (0,1).
Random variables are those that have a behavior in the
reality. For example, the number of clients that arrive each hour at a bank
it depends on the time of day, the day of the week, and other factors.
The generation of random or stochastic variables means obtaining
variables that follow a given probability distribution. Requires
two stages: Generate uniformly distributed random numbers (R)
Generate with R and with the probability distributions the variables
random or stochastic.
The generation of simulated statistics, that is, of the values of the
random variables, they have an entirely numerical nature and must
supported by random numbers, generated by some method.
A sequence of random numbers R1, R2,... must have two important
statistical properties: uniformity and independence. Each number
random Ri is an independent sample taken from a distribution

1
uniform continuous between zero and one. That is, the density function of
probability is:
1
f ( x )= ,a>0 , b >0
( b−a)

If the interval (0, 1) is divided into n classes, or sub-intervals of lengths


equal, the expected number of observations in each interval is N/n,
where N is the total number of observations.
The probability of observing a value in a particular interval is
independent of the previously observed values.
Numbers 'randomly chosen' are useful in various applications, among which
which ones can we mention:
Simulation or Monte Carlo methods: a process is simulated
natural in computational form. These applications are carried out in very
various fields in order to emulate different behaviors: physics (by
example, to simulate collisions between particles), engineering (design of works
hydraulics, bridges, etc.), capital investments, networks, customer services,
call centers, etc. Computer simulation is a
powerful tool for understanding the nature of complex systems.
Sampling: in order to select a sub-sample of a
population.
Numerical Analysis: some techniques to solve problems of
complex numerical analysis has been developed using numbers
random.

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

But the function r(x) = t(x)/c is clearly a density function.


(We assume that such is the case). We must be able to generate (we hope
that easily and quickly) a value of the random variable that follows the
functionr(x). The general algorithm is as follows:
Generate that follows the distribution r(x)

Generate U (0,1), independent of x

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

And we can obtain the global distribution function as

The method consists of generating two random numbers, one is used to


select a piece and the other is used to generate a value for a variable
what follows the distribution of that piece. The value of the obtained variable is the
sought value.
The general algorithm is as follows:
Generate u1, u2 ~ U(0,1)
5
If u1=w1 then generate x~f1(x)
If not
If u1=w1+w2 then generate x~f2(x)
Convolution method
Many random variables including normal, binomial, Poisson, gamma,
Erlang, etc., can be expressed exactly or approximately through the
linear sum of other random variables.
The convolution method can be used as long as the variable
random can be expressed as a linear combination of variables
random:

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

generation of pseudo-random numbers riUniform distribution between 0 and 1.


The method consists of:

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 .

Generate the random variables x, replacing values with


pseudorandom numbers ri~U (0,1) in the inverse cumulative function.
The inverse transform method can also be used to simulate
discrete random variables, such as in Poisson distributions,
of Bernoulli, binomial, geometric, general discrete, etc. The generation is
is carried out through the cumulative probability P(x) and the generation of
numbers pseudorandom rI ~U (0,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

random components variables


Uniform Distribution
From the density function of uniform random variables
between a and b.

The cumulative function is obtained

Equating the cumulative function F(x) with the number


pseudo-randomi~U (0,1), by isolating x you get:
XI=a + (b - a) F(x)I XI=a + (b - a) r
Bernoulli distribution
From the probability distribution of the random variables of
Bernoulli with average p(x) = px (1 - p)1 - x for x=0,1
The probabilities for x=0 and x=1 are calculated, to obtain

By accumulating the values of p(x), we obtain:

9
Generating pseudo-random numbers ri~U (0,1) applies the rule:

The following table shows the daily demand for toothbrushes in a


supermarket

Simulate demand behavior using the method of the


inverse transform.
Based on historical information, point probabilities are calculated and
["the accumulated for x=0, 1, 2, 3"]

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.

The random variables in the simulation of jobs performed, for example


In ProModel, it is necessary to consider the results obtained in the
work done in the program.

11

You might also like