APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.

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

Generating Random Numbers
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
 1  Outline  generation of random variates  convolution  composition  acceptance/rejection  generation of uniform(0, 1) random variates  linear.
Random Numbers. Two Types of Random Numbers 1.True random numbers: True random numbers are generated in non- deterministic ways. They are not predictable.
Random number generation Algorithms and Transforms to Univariate Distributions.
CDA6530: Performance Models of Computers and Networks Chapter 5: Generating Random Number and Random Variables TexPoint fonts used in EMF. Read the TexPoint.
Markov Chains 1.
CHAPTER 16 MARKOV CHAIN MONTE CARLO
BAYESIAN INFERENCE Sampling techniques
June 2, MARKOV CHAIN MONTE CARLO: A Workhorse for Modern Scientific Computation Xiao-Li Meng Department of Statistics Harvard University.
Monte Carlo Simulation Methods - ideal gas. Calculating properties by integration.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
CF-3 Bank Hapoalim Jun-2001 Zvi Wiener Computational Finance.
Using random numbers Simulation: accounts for uncertainty: biology (large number of individuals), physics (large number of particles, quantum mechanics),
Computational statistics, course introduction Course contents  Monte Carlo Methods  Random number generation  Simulation methodology  Bootstrap  Markov.
Probability theory 2011 Main topics in the course on probability theory  The concept of probability – Repetition of basic skills  Multivariate random.
1 Random Number Generation H Plan: –Introduce basics of RN generation –Define concepts and terminology –Introduce RNG methods u Linear Congruential Generator.
Generating Continuous Random Variables some. Quasi-random numbers So far, we learned about pseudo-random sequences and a common method for generating.
Random Number Generation
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
APPENDIX D RANDOM NUMBER GENERATION
Random-Number Generation. 2 Properties of Random Numbers Random Number, R i, must be independently drawn from a uniform distribution with pdf: Two important.
Random Number Generation Fall 2013
Random Number Generation Pseudo-random number Generating Discrete R.V. Generating Continuous R.V.
ETM 607 – Random Number and Random Variates
1 CE 530 Molecular Simulation Lecture 7 David A. Kofke Department of Chemical Engineering SUNY Buffalo
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 11 Some materials adapted from Prof. Keith E. Gubbins:
A SCALABLE LIBRARY FOR PSEUDORANDOM NUMBER GENERATION ALGORITHM 806: SPRNG.
Stochastic Algorithms Some of the fastest known algorithms for certain tasks rely on chance Stochastic/Randomized Algorithms Two common variations – Monte.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.
© 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
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.
Modeling and Simulation Random Number Generators
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Monte Carlo Methods.
Simulated Annealing.
LECTURE 25 SIMULATION AND MODELING Md. Tanvir Al Amin, Lecturer, Dept. of CSE, BUET CSE 411.
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
Suppressing Random Walks in Markov Chain Monte Carlo Using Ordered Overrelaxation Radford M. Neal 발표자 : 장 정 호.
Validating a Random Number Generator Based on: A Test of Randomness Based on the Consecutive Distance Between Random Number Pairs By: Matthew J. Duggan,
CHAPTER 17 O PTIMAL D ESIGN FOR E XPERIMENTAL I NPUTS Organization of chapter in ISSO –Background Motivation Finite sample and asymptotic (continuous)
Pseudo-random-number generators. Random numbers: the numbers generated by a stochastic process They are indispensible in any simulations based on radom.
R ANDOM N UMBER G ENERATORS Modeling and Simulation CS
Gil McVean, Department of Statistics Thursday February 12 th 2009 Monte Carlo simulation.
G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1 Statistical Data Analysis: Lecture 5 1Probability, Bayes’ theorem 2Random variables and.
Kevin Stevenson AST 4762/5765. What is MCMC?  Random sampling algorithm  Estimates model parameters and their uncertainty  Only samples regions of.
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
MONTE CARLO METHOD DISCRETE SIMULATION RANDOM NUMBER GENERATION Chapter 3 : Random Number Generation.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
Generating Random Variates
Advanced Statistical Computing Fall 2016
Basic simulation methodology
Main topics in the course on probability theory
Intro to Sampling Methods
Random Number Generators
Markov chain monte carlo
Some Rules for Expectation
Hidden Markov Models Part 2: Algorithms
Random-Number Generation
Chapter 7 Random Number Generation
Chapter 7 Random-Number Generation
Computing and Statistical Data Analysis Stat 3: The Monte Carlo Method
Computer Simulation Techniques Generating Pseudo-Random Numbers
Generating Random Variates
Presentation transcript:

APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random number generator – Random variates with general distribution Different types of random number generators *Note: These slides cover some topics not included in ISSO Slides for Introduction to Stochastic Search and Optimization (ISSO) by J. C. Spall

D-2 Uniform Random Number Generators Want a sequence of independent, identically distributed U(0, 1) random variables However, random number generators (RNGs) produce a deterministic and periodic sequence of numbers What qualities should the generators have?

D-3 Criteria for ‘Good’ Random Number Generators Long period Good distribution of the points (low discrepancy) Able to pass some statistical tests Speed/efficiency Portability – can be implemented easily using different languages and computers Repeatability – should be able to generate the same sequence over again

D-4 Generating Random Numbers Given a transition function, f, the state at step n is given by The output function, g, produces the outputs as The output sequence is Want the sequence period to be close to 2 b, where b corresponds to the number of bits

D-5 Types of Random Number Generators Linear – most commonly used Combined – can increase period and improve statistical properties Non-linear – structure is less regular than linear generators but more difficult to implement

D-6 Linear Congruential Generators U(0,1) numbers via linear congruential generators (LCG) are calculated by These are the most widely used and studied random number generators The values a, c, and m should be carefully chosen

D-7 Linear Congruential Generators Some values for a and m (assuming c = 0) –a = 23, m = (original implementation) –a = 65534, m = 2 29 (poor because of high order correlations) –a = 5 15, m = 2 47 (long period, good distribution, but lower order bits should not be trusted) –a = 16807, m = 2 31 –1 (this has been discussed as the minimum standard for RNGs)

D Empirical Mean Number of Samples m = 9, a = 4, c = 1 m = 27, a = 26, c = 5 m = 482, a = 13, c = 14 m = 2 31 – 1, a = 4, c = 1

D-9 Lattice Structure (Exercise D.2) UkUk Uk–-1Uk–-1 30 points UkUk Uk–-1Uk–-1 96 points

D-10 Fibonacci Generators These are generators where the current value is the sum (or difference, or XOR) or the two preceding elements Lagged Fibonacci generators use two numbers earlier in the sequence

D-11 Multiple Recursive Generators Multiple recursive generators (MRGs)are defined by where the a i belong to {0,1,…,m – 1} and For prime m and properly chosen a i ’s, the maximal period is m k -1

D-12 Combining Generators Used to increase period length and improve statistical properties Shuffling: uses the second generator to choose a random order for the numbers produced by the final generator Bit mixing: combines the numbers in the two sequences using some logical or arithmetic operation (addition and subtraction are preferred)

D-13 Nonlinear Generators Nonlinearity can be introduced by using a linear transition function with a nonlinear output function An example is the explicit inversive generator where

D-14 Random Number Generators Used in Common Software Packages Important to understand the types of generators used in statistical software packages and their limitations MATLAB: –Versions earlier than 5: a linear congruential generator with –Versions 5 & 6: a lagged Fibonacci generator combined with a shift register random integer generator with period EXCEL: u n = fractional part (9821×u n – ); period SAS (v6): LCG with period

D-15 Inverse-Transform Method for Generating Non-U(0,1) Random Numbers Let F(x) be the distribution function of X Define the inverse function of F by Generate X by Example: exponential distribution

D-16 Accept  Reject Method Let p X (x) be the density function of X Find a function  (x) that majorizes p X (x) –, q is a density function Generate X by –Generate U from U(0,1) (*) –Generate Y from q(y), independent of U –If, then set X=Y. Otherwise, go back to (*) Probability of acceptance (efficiency) = 1/c Related to Markov chain Monte Carlo (MCMC) method (see Exercise 16.4)

D-17 pX(x)pX(x) q(x) = U(0,1)

D-18 U ~ U(0,1): , , , , ,  Y ~ q(y)  U(0,1): , , , , ,  : , ,  X ~ P X (x): , ,  reject accept

D-19 References for Further Study L’Ecuyer, P. (1998), “Random Number Generation,”in Handbook of Simulation: Principles, Methodology, Advances, Applications, and Practice (J. Banks, ed.), Wiley, New York, Chapter 4. Neiderreiter, H. (1992), Random Number Generation and Quasi-Monte Carlo Methods, SIAM, Philadelphia.