 1  Outline  generation of random variates  convolution  composition  acceptance/rejection  generation of uniform(0, 1) random variates  linear.

Slides:



Advertisements
Similar presentations
RSLAB-NTU Lab for Remote Sensing Hydrology and Spatial Modeling 1 An Introduction to R Pseudo Random Number Generation (PRNG) Prof. Ke-Sheng Cheng Dept.
Advertisements

Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
Materials for Lecture 11 Chapters 3 and 6 Chapter 16 Section 4.0 and 5.0 Lecture 11 Pseudo Random LHC.xls Lecture 11 Validation Tests.xls Next 4 slides.
Outline input analysis input analyzer of ARENA parameter estimation
ISE525: Generating Random Variables. Sources of randomness in a computer? Methods for generating random numbers: – Time of day (Seconds since midnight)
Statistics review of basic probability and statistics.
 1  Outline  terminating and non-terminating systems  theories for output analysis  Strong Law of Large Numbers  Central Limit Theorem  Regenerative.
 1  Outline  terminating and non-terminating systems  analysis of terminating systems  generation of random numbers  simulation by Excel  a terminating.
Chapter 8 Random-Variate Generation
The Multiple Regression Model Prepared by Vera Tabakova, East Carolina University.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
Random-Variate Generation. Need for Random-Variates We, usually, model uncertainty and unpredictability with statistical distributions Thereby, in order.
Simulation Modeling and Analysis
Generating Random Numbers
Simulation Modeling and Analysis
1 Random Number Generation H Plan: –Introduce basics of RN generation –Define concepts and terminology –Introduce RNG methods u Linear Congruential Generator.
Simulation Modeling and Analysis Session 12 Comparing Alternative System Designs.
Random Number Generation
Variance Reduction Techniques
Distinguishing Features of Simulation Time (CLK)  DYNAMIC focused on this aspect during the modeling section of the course Pseudorandom variables (RND)
Chapter 11 Multiple Regression.
OMS 201 Review. Range The range of a data set is the difference between the largest and smallest data values. It is the simplest measure of dispersion.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 14 Goodness-of-Fit Tests and Categorical Data Analysis.
Continuous Random Variables and Probability Distributions
Experimental Evaluation
1 Simulation Modeling and Analysis Pseudo-Random Numbers.
Properties of Random Numbers
Random-Number Generation. 2 Properties of Random Numbers Random Number, R i, must be independently drawn from a uniform distribution with pdf: Two important.
1 Terminating Statistical Analysis By Dr. Jason Merrick.
Fall 2011 CSC 446/546 Part 6: Random Number Generation.
Random Number Generation Pseudo-random number Generating Discrete R.V. Generating Continuous R.V.
ETM 607 – Random Number and Random Variates
Simulation Output Analysis
The paired sample experiment The paired t test. Frequently one is interested in comparing the effects of two treatments (drugs, etc…) on a response variable.
 1  Outline  input analysis  goodness of fit  randomness  independence of factors  homogeneity of data  Model
 1  Outline  stages and topics in simulation  generation of random variates.
Statistical Decision Theory
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
2 Input models provide the driving force for a simulation model. The quality of the output is no better than the quality of inputs. We will discuss the.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.
1 Statistical Distribution Fitting Dr. Jason Merrick.
© 2003, Carla Ellis Simulation Techniques Overview Simulation environments emulation exec- driven sim trace- driven sim stochastic sim Workload parameters.
CPSC 531: RN Generation1 CPSC 531:Random-Number Generation Instructor: Anirban Mahanti Office: ICT Class Location:
Chapter 7 Random-Number Generation
Tests for Random Numbers Dr. Akram Ibrahim Aly Lecture (9)
CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad bin Saud University 15 October 2010 Lecture 05: Statistical Analysis Tools.
Module 1: Statistical Issues in Micro simulation Paul Sousa.
Basic Concepts in Number Theory Background for Random Number Generation 1.For any pair of integers n and m, m  0, there exists a unique pair of integers.
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
Confidence intervals and hypothesis testing Petter Mostad
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © Dr. John Lipp.
Lecture 3: Statistics Review I Date: 9/3/02  Distributions  Likelihood  Hypothesis tests.
Variance Reduction Techniques
Continuous Random Variables and Probability Distributions
Tutorial I: Missing Value Analysis
STA347 - week 91 Random Vectors and Matrices A random vector is a vector whose elements are random variables. The collective behavior of a p x 1 random.
Gil McVean, Department of Statistics Thursday February 12 th 2009 Monte Carlo simulation.
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
UNIFORM RANDOM NUMBER GENERATION Chapter 7 (first half) The goal is to generate a sequence of The goal is to generate a sequence of Uniformly distributed.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
Generating Random Variates
Chapter 4 Basic Estimation Techniques
STAT 312 Chapter 7 - Statistical Intervals Based on a Single Sample
Random-Number Generation
Chapter 7 Random Number Generation
Chapter 7 Random-Number Generation
Properties of Random Numbers
Computer Simulation Techniques Generating Pseudo-Random Numbers
Random Number Generation
Presentation transcript:

 1  Outline  generation of random variates  convolution  composition  acceptance/rejection  generation of uniform(0, 1) random variates  linear congruential generators  generator in ARENA  tests of generators

 2  Convolution  X = b 1 Y b n Y n  generate variates of Y 1 to Y n  sum b i Y i to get X Example for Binomial Example for Triangular Example for Erlang (k,  )

 3  Composition equivalent form in distribution F(x) = p 1 F 1 (x ) p 1 F k (x ) use a zero-one uniform variate to determine the “type” and then generate the corresponding Y variate

 4  Acceptance / Rejection  generate a variate from the uniform distribution on a disc of unit radius  1 o generate a variate of (X, Y) such that X, Y X, Y ~ i.i.d. uniform [-1, 1]  2 o accept (x, y) to be the desirable variate if x 2 + y 2  1; else go to 1 o  result: uniform in {(x, y)| x 2 + y 2  1}

 5  Acceptance / Rejection Acceptance / Rejection – Discrete Distribution Acceptance / Rejection  X ~ {p i }; Y ~ {q i } such that p i /q i  c for all i  1 o Generate y from Y ~ {q i }.  2 o Generate u from U.  3 o If cq y u < p y, set x = y and stop; else go to 1 o. similar procedure applicable to continuous distribution with {p i }, {q i } replaced by the corresponding density functions primarily for continuous distributions whose F -1 is hard to find

 6  Pseudo-Random Numbers  linear congruential generator linear congruential generator  Z i = (a Z i-1 + c) mod M  U i = Z i /M  Z 0 = seed (initial value)  for large M and suitably chosen a, c, M  Z i approximately ~ discrete uniform [0, M]  U i approximately ~ uniform [0, 1]

 7  Comments on Linear Congruential Generators  {Z i }: a deterministic sequence given Z 0  sequence can change with seeds  sequences may not of full cycles (< M)  random numbers from LCG lie on planes of a hyper unit cube

 8  Comments on Linear Congruential Generators  all right to use multiplicative LCG, i.e., c = 0  full period for suitable choice of M and a  Common Multiplicative LCG aM 44, 485, 709, 377,

 9  The Current (2000) Arena RNG  use some but not all idea of LCG  CMRG - Combined multiple recursive generator A n = ( A n-2 – A n-3 ) mod B n = ( B n-1 – B n-3 ) mod Z n = (A n – B n ) mod Seed = a six-vector of first three A n ’ s, B n ’ s Two simultaneous recursions Z n / if Z n > / if Z n = 0 U n =

 10  The Current (2000) Arena RNG – Properties  extremely good statistical properties  good uniformity in up to 45-dimensional hypercube  cycle length = 3.1   to cycle, all six seeds must match up  on 600 MHz PC: 8.4  millennia to exhaust  only slightly slower than old LCG

 11  The Current (2000) Arena RNG – Streams and Substreams  automatic streams and substreams  1.8  streams of length 1.7  each  a stream: 2.3  substreams of length 7.6  each  default stream is 10 (historical reasons)  possible to specify a different stream  e.g., EXPO(6.7, 4) to use stream 4  ARENA automatically advances to next substream in each stream for each replication  helps synchronize for variance reduction

 12  Statistical Tests of Zero-One Random Number Generators  check whether data are from i.i.d. unif[0, 1]  quick test: mean and variance  goodness of fit:  2 test; K-S test  i.i.d.: j-lag correlation; run-up length  philosophy of tests: whether empirical evidence supports the statistical property under consideration

 13  Quick Tests by Excel mean? sample variance? confidence Interval?

 14  Goodness of Fit Test –  2 Test  idea: the actual number of sample points in a given range should be close to the expected number in some sense  M ranges (categories)  e i : expected # of sample values in the ith range  a i : actual # of sample values in the ith range

 15  Goodness of Fit Test –  2 Test approximately  2 distribution of M-1 degree of freedom lose one degree of freedom for each estimated parameter

 16  Theory and Main Idea of  2 Goodness of Fit Test  (X 1, X 2,..., X k ) ~ Multinomial (n; p 1, p 2,..., p k )

 17  Goodness-of-Fit Test  “better” to have e i = e j for i not equal to j  for this method to work, e i  5  choose significant level   decision: if, reject H 0 ; otherwise, accept H 0.

 18  Goodness of Fit Test – K-S Test F(x)F(x) x empirical distribution compare with the distribution of unif[0, 1]

 19  Goodness of Fit Test – K-S Test F(x)F(x) x largest difference find the “distance” between the empirical data and the uniform [0, 1] distribution the largest difference follow certain well defined distribution for n  20, D 0.05  1.36/(n) 0.5 D 0.01  1.63/(n) 0.5

 20  j-lag Correlation Test  i.i.d. uniform [0, 1] random variables: covariance stationary random variables  estimate  j by:  if the data are truly uniform [0, 1]: cov(U i U i+j )/V(U i )

 21  Run-up Length Test run ups can show that the lengths of runs are i.i.d. after deleting the numbers that start runs                      values of random variates order of random variates new length of runs becomes: 3, 4, 1, 0, 2, 1, 0, 2 discard

 22  Run-up Length Test ✦ distribution of lengths (after deleting numbers that start runs): ✦ can use goodness of fit test to check the distributions of the run lengths