Study Notes on Random Variate Generation in Computer Simulation
Computer Simulation Module 7: Random Variate Generation
Introduction
Instructor: Dave Goldsman, Ph.D.
Affiliation: Stewart School of Industrial and Systems Engineering
Module Focus: Random variate generation (RV generation) using previously learned techniques, specifically from Uniform(0,1) pseudo-random numbers (PRNs).
Module Outline
Introduction to RV Generation
Inverse Transform Method
Continuous Examples
Discrete Examples
Empirical Distribution Example
Convolution Method
Acceptance-Rejection Method
Proof of Inverse Transform Method
More Continuous Examples
Poisson Example
Composition Method
Box-Muller Normal Distributions
Order Statistics and Other Concepts
Multivariate Normal Distribution
Baby Stochastic Processes
Nonhomogeneous Poisson Processes (NHPPs)
Time Series Analysis
Queueing Processes
Brownian Motion
Introduction (Overall Goals)
The objective: Transform a Uniform(0,1) number to generate random variates from different distributions (both discrete and continuous).
Aim to ensure that the process is fast and reproducible.
Types of distributions addressed in this module:
Discrete distributions: Bernoulli, Binomial, Poisson
Continuous distributions: Exponential, Normal, Weibull, Empirical.
Exploring multivariate normal and Autoregressive (AR) processes, as well as generating waiting times and Brownian motion.
Inverse Transform Method
Inverse Transform Theorem
Definition: Let $X$ be a continuous random variable with cumulative distribution function (c.d.f.) $F(x)$. If $U$ is uniformly distributed on [0, 1], then the inverse transform yields that $X = F^{-1}(U)$ has the same distribution as $X$.
Proof: Consider $U$ and assume that $Y = F^{-1}(U)$. Then:
$P(Y < y) = P(F^{-1}(U) < y) = P(U < F(y)) = F(y)$.
Utilization of the Inverse Transform Method: For a random variable distributed as $F$, simply generate $U ext{ from Uniform(0, 1)}$, then compute $Y = F^{-1}(U)$.
Example: For a Uniform distribution on [a, b], use $Y = a + (b-a)U$.
Continuous Examples of the Inverse Transform Method
Example 1: Weibull Distribution
c.d.f.: $F(x) = 1 - e^{-( rac{x}{eta})^ heta}$, for $x ext{ greater than } 0$.
To find $F^{-1}(U)$:
Set up the equation and solve for $x$.
Example 2: Triangular Distribution
p.d.f. defined on [0, 2]:
$f(x) = rac{x}{2}$ for $0 < x < 1$.
$f(x) = rac{2-x}{2}$ for $1 ext{ < } x < 2$.
Its c.d.f. is segmented depending on intervals of $x$.
Box-Muller Method for Generating Normals
Objective: To generate standard normal variables.
Theorem: If $U1$ and $U2$ are independent random variables uniformly distributed on (0, 1), then $Z1 = ext{sqrt}(-2 ext{ln}(U1)) ext{cos}(2 ext{π}U2)$ and $Z2 = ext{sqrt}(-2 ext{ln}(U1)) ext{sin}(2 ext{π}U2)$ are independent standard normal random variables.
Utilization: Each generated normal variable can be transformed via linear transformations to obtain variables with different means and variances.
Acceptance-Rejection Method
Introduction
Purpose: Useful for distributions that are difficult to sample from directly. It generates samples from a proposal distribution and accepts/rejects based on a defined criterion.
Basic Algorithm:
Generate a random variable $Z$ from the proposal distribution.
Generate $U ext{ from } Uniform(0, 1)$.
Accept $Z$ if $U < rac{f(Z)}{M t(Z)}$, where $M$ is a scaling constant and $t(Z)$ is the proposal distribution.
Linear Time Series Analysis
Introduction to Time Series Processes
First-order autoregressive (AR(1)) process: Defined by the equation $Yt = heta Y{t-1} + ext{error term}$.
First-order moving average (MA(1)) process: Defined similarly with past error terms.
Autoregressive Integrated Moving Average (ARIMA) models: Models that combine AR and MA processes together.
Queueing Theory
M/M/1 Queue Model
System Description: A queueing model featuring single server; arrivals are governed by a Poisson process, and service completion times are exponentially distributed.
Objective: To generate waiting times and service times within this framework.
Key formulas: Use Lindley’s equation for waiting time, which relates inter-arrival and service times.
Convolution of Random Variables
Application of Convolution
Definition: Convolution refers to the summation of random variables. If you have independent identically distributed (i.i.d.) random variables, the sum behaves according to the convolution of their respective probability distributions.
Importance of Simple Distributions
For example, the sum of two uniform random variables will yield a triangle distribution.
Brownian Motion and Applications
Concept and Definition
Definition: A stochastic process that exhibits continuous paths; formally defined by the Wiener process.
Properties: Features include stationary and independent increments, meaning that increments in non-overlapping intervals are independent.
Applications: Often applied in financial modeling and various simulation tasks across operations research and industrial engineering.
Conclusion of Module 7
Objective Achieved: Reviewed various methods for generating random variates effectively, including continuous and discrete techniques and their applications in simulations.
Next Step: Transition to Input Modeling to determine how to select distributions for simulation purposes.