Random processes and probability distributions. Phys 420/580 Lecture 20

Similar documents
Class 12. Random Numbers

Monte Carlo Techniques

Lecture 20. Randomness and Monte Carlo. J. Chaudhry. Department of Mathematics and Statistics University of New Mexico

Review of Statistical Terminology

14 Random Variables and Simulation

Random numbers and generators

Random Number Generation. Stephen Booth David Henty

2008 Winton. Review of Statistical Terminology

CPSC 531: Random Numbers. Jonathan Hudson Department of Computer Science University of Calgary

Chapter 4: Monte Carlo Methods. Paisan Nakmahachalasint

From Random Numbers to Monte Carlo. Random Numbers, Random Walks, Diffusion, Monte Carlo integration, and all that

Monte Carlo. Lecture 15 4/9/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

B. Maddah ENMG 622 Simulation 11/11/08

Random numbers and random number generators

( x) ( ) F ( ) ( ) ( ) Prob( ) ( ) ( ) X x F x f s ds

UNIT 5:Random number generation And Variation Generation

Probability Distributions

Slides 3: Random Numbers

Physics 403. Segev BenZvi. Monte Carlo Techniques. Department of Physics and Astronomy University of Rochester

Topics in Computer Mathematics

Systems Simulation Chapter 7: Random-Number Generation

Algorithms and Networking for Computer Games

Uniform random numbers generators

Intelligent Systems I

B.N.Bandodkar College of Science, Thane. Random-Number Generation. Mrs M.J.Gholba

Sources of randomness

Probability Distributions - Lecture 5

Generating Uniform Random Numbers

Monte Carlo methods for kinetic equations

Random Number Generation. CS1538: Introduction to simulations

One-Parameter Processes, Usually Functions of Time

Physics 403 Probability Distributions II: More Properties of PDFs and PMFs

How does the computer generate observations from various distributions specified after input analysis?

Lecture 2 : CS6205 Advanced Modeling and Simulation

Generating Random Variables

Random number generation

Department of Electrical- and Information Technology. ETS061 Lecture 3, Verification, Validation and Input

STA 294: Stochastic Processes & Bayesian Nonparametrics

Numerical methods for lattice field theory

Brandon C. Kelly (Harvard Smithsonian Center for Astrophysics)

Statistics, Data Analysis, and Simulation SS 2013

MTH739U/P: Topics in Scientific Computing Autumn 2016 Week 6

Physics 403 Monte Carlo Techniques

2 Random Variable Generation

A simple algorithm that will generate a sequence of integers between 0 and m is:

Generating Uniform Random Numbers

PHY411 Lecture notes Part 5

General Principles in Random Variates Generation

How does the computer generate observations from various distributions specified after input analysis?

Lecture 5: Random numbers and Monte Carlo (Numerical Recipes, Chapter 7) Motivations for generating random numbers

Uniform Random Number Generators

Random number generators and random processes. Statistics and probability intro. Peg board example. Peg board example. Notes. Eugeniy E.

Monte Carlo Simulations

Today: Fundamentals of Monte Carlo

Monte Carlo integration (naive Monte Carlo)

functions Poisson distribution Normal distribution Arbitrary functions

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

Physics Dec The Maxwell Velocity Distribution

4.5 Applications of Congruences

Random Number Generators

Cheng Soon Ong & Christian Walder. Canberra February June 2018

Generating Uniform Random Numbers

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

Lecture - 30 Stationary Processes

Lecture Notes. Advanced Discrete Structures COT S

Hochdimensionale Integration

Lehmer Random Number Generators: Introduction

cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications

MA1131 Lecture 15 (2 & 3/12/2010) 77. dx dx v + udv dx. (uv) = v du dx dx + dx dx dx

MD Thermodynamics. Lecture 12 3/26/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Ch3. Generating Random Variates with Non-Uniform Distributions

Section 2.1: Lehmer Random Number Generators: Introduction

METHODS FOR GENERATION OF RANDOM NUMBERS IN PARALLEL STOCHASTIC ALGORITHMS FOR GLOBAL OPTIMIZATION

Commutative Rings and Fields

Today: Fundamentals of Monte Carlo

Data Analysis I. Dr Martin Hendry, Dept of Physics and Astronomy University of Glasgow, UK. 10 lectures, beginning October 2006

( ) ( ) Monte Carlo Methods Interested in. E f X = f x d x. Examples:

Finally, a theory of random number generation

Generating the Sample

1. Prove that the number cannot be represented as a 2 +3b 2 for any integers a and b. (Hint: Consider the remainder mod 3).

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

Monte Carlo Methods. Jesús Fernández-Villaverde University of Pennsylvania

Modern Methods of Data Analysis - WS 07/08

MATH 115, SUMMER 2012 LECTURE 12

So we will instead use the Jacobian method for inferring the PDF of functionally related random variables; see Bertsekas & Tsitsiklis Sec. 4.1.

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

In Z: x + 3 = 2 3x = 2 x = 1 No solution In Q: 3x = 2 x 2 = 2. x = 2 No solution. In R: x 2 = 2 x = 0 x = ± 2 No solution Z Q.

Symbolic Dynamics of Digital Signal Processing Systems

STEP Support Programme. Pure STEP 1 Questions

Today: Fundamentals of Monte Carlo

π π π points:= { seq([n*cos(pi/4*n), N*sin(Pi/4*N)], N=0..120) }:

FERMAT S TEST KEITH CONRAD

cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications

Monte Carlo Radiation Transfer I

Monte Carlo (MC) Simulation Methods. Elisa Fadda

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5

Topic Contents. Factoring Methods. Unit 3: Factoring Methods. Finding the square root of a number

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

Engineering Physics 1 Dr. B. K. Patra Department of Physics Indian Institute of Technology-Roorkee

Transcription:

Random processes and probability distributions Phys 420/580 Lecture 20

Random processes Many physical processes are random in character: e.g., nuclear decay (Poisson distributed event count) P (k, τ) = e λτ (λτ) k! motion of thermalized interacting particles (Maxwell-Boltzmann speed profile) f(v) v 2 exp mv2 2kT

Random processes Probabilistic descriptions often arise from the complex behaviour of many interacting degrees of freedom E.g., Temperature is an emergent phenomenon: it s a collective property of a large number of interacting particles particles exchange energy and establish a MB distribution, characterized by a single parameter T

Ergodicity For a large collection of noninteracting oscillators, the phase space trajectory of each individual p oscillator is a closed circle q

Ergodicity For a large collection of noninteracting oscillators, the phase space trajectory of each individual p oscillator is a closed circle As we turn on interactions, the trajectories are perturbed q

Ergodicity For a large collection of noninteracting oscillators, the phase space trajectory of each individual p oscillator is a closed circle As we turn on interactions, the trajectories are perturbed q The trajectory density averaged over all oscillators can be understood as a probability density

Ergodicity Consider an idealized billiards system... non-ergodic ergodic

Statistical physics Ergodicity is the basis for statistical physics We assume that all states in the phase space are accessible and have equal weight In a system at fixed temperature, states are visited according to the Boltzmann factor: Z = e E n/kt n Stochastic process with transition probabilities given by P n m e (E n E m )/kt

Random numbers What is a random number? Really no such thing Loose term of art referring to a sequence of independent numbers drawn randomly from some distribution Typically these are integer or real values uniformly distributed in some finite range

Random numbers An infinite sequence of digits: 99181956211585263425870769311327827177953470784192 Is it random? (Humans are terrible at judging) Each of the digits 0 9occurs 10 of the time 1 Each pair of two successive digits occurs 1 100 of the time

Random numbers Consider the first one million digits of the sequence: digit counts are distributed around the average every pattern is equally probable P (000000 )=P (193273 ) digits are completely uncorrelated given 000000 0x, P (x = 0) = 1 10

Random numbers How do we generate sequences of random numbers? Strictly speaking, this isn t possible on a deterministic computer using finite arithmetic Nonetheless, it may be possible to construct long sequences with the appearance of randomness Probably okay if the relationship between numbers has no physical significance

Linear congruential generator Want a random sequence of real numbers (U n ) [0, 1) Popular strategy: use fractions U n = X n /m built from the sequence of integers (X n ) {0, 1, 2,...,m 1} linear congruence scheme (Lehmer 1948) X n+1 =(ax n + c) mod m

Linear congruential generator Want a random sequence of real numbers (U n ) [0, 1) Popular strategy: use fractions U n = X n /m built from the sequence of integers (X n ) {0, 1, 2,...,m 1} linear congruence scheme (Lehmer 1948) X n+1 =(ax n + c) mod m multiplier increment modulus

Linear congruential generator Recursion builds off an initial seed value, X 0 X 0 X 1 =(ax 0 + c) mod m X 2 =(a[(ax 0 + c) mod m]+c) mod m... Requires careful choice of parameters: (X n )=7, 6, 9, 0, 7, 6, 9, 0,... X 0 = a = c =7 m = 10

Linear congruential generator Recursion builds off an initial seed value, X 0 X 0 X 1 =(ax 0 + c) mod m X 2 =(a[(ax 0 + c) mod m]+c) mod m... Requires careful choice of parameters: (X n )=7, 6, 9, 0, 7, 6, 9, 0,... X 0 = a = c =7 m = 10 very non-random, period 4

Linear congruential generator Any generator of the form X n+1 = F (X n ) taking m distinct values must be periodic with period P m For a linear congruential generator, one can show that the period is maximum if c is relatively prime to m; b = a 1 is a multiple of p, for very prime p dividing m b is a multiple of 4, if m is a multiple of 4.

Linear congruential generator For the sake of efficiency, specialize to the case m =2 32 Advantages: each integer fits into exactly one computer word the modulus (an expensive division operation) is automatically handled in hardware by overflow A specialized version of the maximum period rule: c =1 a 5 mod 8

Linear congruential generator A long repeating cycle does not imply randomness: (X n )=0, 1, 2,...,m 1 (a = c = 1) We require weak correlation between elements, X j X k X j X k (j = k), especially when j k is small Judged empirically via statistical tests (Die Hard)

Linear congruential generator Some other considerations: a = 10,c= 23,m= 566 best if a/m is not too small least significant bits are more X 2n+1 highly correlated complete orbits lie in hyperplanes (Marsaglia 1968): X 2n (X 0,X 1,...,X q 1 ), (X q,x q+1,...,x 2q 1 ),...

Probability distributions Suppose there are N discrete events occur with probabilities p 1,p 2,...,p N Since something must happen, the total sum is p 1 + p 2 + + p N =1 Given a randomly generated number ξ [0, 1], how can we select one of the N events?

Probability distributions Each even i occupies a width p i in the interval: 1 0 < ξ <p 1 2 p 1 < ξ <p 1 + p 2 3 p 1 + p 2 < ξ <p 1 + p 2 + p 3... N p 1 + + p N 1 < ξ < 1 p 0 1 p 2 p N 1

Probability distributions The relevant quantity is the cumulative probability, P i = i j=1 p j Similarly, for continuous distributions, we construct a cumulative probability distribution P (x) = x from the probability density dy p(y) p(x)

Probability distributions Sampling via p(x) x P 1 ([0, 1]) P(x) ξ x x p(x) P(x) ξ x x

Inverse transform method Example: p(x) = (1/λ)e x/λ if 0 x< 0 if x<0 Back map gives ξ P (x) = x 0 dy p(y) =1 e x/λ By inversion, we see that x λ ln(1 ξ) with ξ drawn uniformly from [0, 1] is equivalent to x drawn from the nonuniform distribution p(x)

Inverse transform method What about cases where no analytic inverse exists? In some cases, related multivariate distributions are invertible: e.g. Gaussian distribution p(x) = e x2 /2σ 2 2πσ 2 Consider the product p(x, y) =p(x)p(y) = e (x2 +y 2 )/2σ 2 2πσ 2

Inverse transform method From radial coordinates r = x 2 + y 2 θ = tan 1 (y/x) we can further transform ρ = r 2 /2 so that p(ρ, θ)dρ dθ = 1 2π e ρ dρ dθ x = 2ρ cos θ y = 2ρ sin θ Sampling is now possible with two random variables: x 2 ln(1 ξ 1 ) cos(2πξ 2 ) (Box-Muller)

Rejection method When P (x) is not easily invertible and no other tricks can be applied, try the following rejection method: Generate a sequence (x 1,x 2,x 3, ) with the elements drawn uniformly from [x min,x max ] Generate a sequence (ξ 1, ξ 2, ξ 3, ) with the elements drawn uniformly from [0,p max ] Discard elements from the first sequence if p(x i ) < ξ i

Rejection method Works by throwing away p(x) reject results that are rare p max Some limitations: the probability distribution must be bounded and have a finite range x min x max x accept