Random Processes DS GA 1002 Probability and Statistics for Data - - PowerPoint PPT Presentation

random processes
SMART_READER_LITE
LIVE PREVIEW

Random Processes DS GA 1002 Probability and Statistics for Data - - PowerPoint PPT Presentation

Random Processes DS GA 1002 Probability and Statistics for Data Science http://www.cims.nyu.edu/~cfgranda/pages/DSGA1002_fall17 Carlos Fernandez-Granda Aim Modeling quantities that evolve in time (or space) Trajectory of a particle, price of


slide-1
SLIDE 1

Random Processes

DS GA 1002 Probability and Statistics for Data Science

http://www.cims.nyu.edu/~cfgranda/pages/DSGA1002_fall17 Carlos Fernandez-Granda

slide-2
SLIDE 2

Aim

Modeling quantities that evolve in time (or space) Trajectory of a particle, price of oil, temperature in New York. . .

slide-3
SLIDE 3

Definition Mean and autocovariance functions Important random processes

slide-4
SLIDE 4

Notation

We denote random processes using a tilde over an upper case letter

  • X
slide-5
SLIDE 5

Formal definition

Given a probability space (Ω, F, P), a random process X is a function that maps each ω ∈ Ω to a function X (ω, ·) : T → R There are two interpretations for X (ω, t)

  • 1. If we fix ω, then

X (ω, t) is a deterministic function or realization of t

  • 2. If we fix t then

X (ω, t) is a random variable, usually denoted by X (t)

slide-6
SLIDE 6

Continuous and discrete random processes

We can classify a random process depending on the indexing variable t

◮ If t is defined on a continuous interval, the process is continuous ◮ If t is defined on a discrete set, the process is discrete

slide-7
SLIDE 7

State space

Set of possible values of the random variable X (t) for any t It can be continuous or discrete (also finite) There are continuous-state discrete-time random processes and discrete-state continuous-time random processes

slide-8
SLIDE 8

Puddle

Initial amount of water is uniform between 0 and 1 gallon After a time interval t there is t times less water Continuous-state continuous-time random process C

  • C (ω, t) := ω

t t ∈ [1, ∞)

slide-9
SLIDE 9

Puddle

2 4 6 8 10 0.2 0.4 0.6 0.8 1 t

  • C (ω, t)

ω = 0.62 ω = 0.91 ω = 0.12

slide-10
SLIDE 10

Puddle

We only care about how much water there is on day i Continuous-state discrete-time random process D

  • D (ω, i) := ω

i , i = 1, 2, . . .

slide-11
SLIDE 11

Puddle

1 2 3 4 5 6 7 8 9 10 0.2 0.4 0.6 0.8 i

  • D (ω, i)

ω = 0.31 ω = 0.89 ω = 0.52

slide-12
SLIDE 12

nth-order distribution

Joint distribution of X (t1), X (t2), . . . , X (tn) for any {t1, t2, . . . , tn} If X (t1), X (t2), . . . , X (tn) have the same joint distribution as X (t1 + τ), X (t2 + τ), . . . , X (tn + τ) for any τ the process is strictly/strongly stationary

slide-13
SLIDE 13

Puddle

F

C(t) (x)

slide-14
SLIDE 14

Puddle

F

C(t) (x) := P

  • C (t) ≤ x
slide-15
SLIDE 15

Puddle

F

C(t) (x) := P

  • C (t) ≤ x
  • = P (ω ≤ t x)
slide-16
SLIDE 16

Puddle

F

C(t) (x) := P

  • C (t) ≤ x
  • = P (ω ≤ t x)

=      t x

u=0 du = t x

if 0 ≤ x ≤ 1

t

1 if x > 1

t

if x < 0

slide-17
SLIDE 17

Puddle

F

C(t) (x) := P

  • C (t) ≤ x
  • = P (ω ≤ t x)

=      t x

u=0 du = t x

if 0 ≤ x ≤ 1

t

1 if x > 1

t

if x < 0 f

C(t) (x) =

  • t

if 0 ≤ x ≤ 1

t

  • therwise
slide-18
SLIDE 18

How to specify a random process

Three options:

slide-19
SLIDE 19

How to specify a random process

Three options:

  • 1. Define probability space and a function from Ω to a set of functions
slide-20
SLIDE 20

How to specify a random process

Three options:

  • 1. Define probability space and a function from Ω to a set of functions
  • 2. Define all nth-order distributions for all n ≥ 0
slide-21
SLIDE 21

How to specify a random process

Three options:

  • 1. Define probability space and a function from Ω to a set of functions
  • 2. Define all nth-order distributions for all n ≥ 0
  • 3. Express it as a function of another random process
slide-22
SLIDE 22

Definition Mean and autocovariance functions Important random processes

slide-23
SLIDE 23

Mean

The mean of a random process is the function µ

X (t) := E

  • X (t)
  • It is a deterministic function of t
slide-24
SLIDE 24

Autocovariance

The autocovariance of a random process is the function R

X (t1, t2) := Cov

  • X (t1) ,

X (t2)

  • In particular,

R

X (t, t) := Var

  • X (t)
slide-25
SLIDE 25

Wide-sense/weakly stationary process

A process is stationary in a wide or weak sense if its mean is constant µ

X (t) := µ

and its autocovariance function is shift invariant, i.e. R

X (t1, t2) := R X (t1 + τ, t2 + τ)

for any t1 and t2 and any shift τ Common notation R

X (s) := R X (t, t + s)

slide-26
SLIDE 26

Autocovariance function

15 10 5 5 10 15 s 0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 R(s)

slide-27
SLIDE 27

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-28
SLIDE 28

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-29
SLIDE 29

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-30
SLIDE 30

Autocovariance function

15 10 5 5 10 15 s 0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 R(s)

slide-31
SLIDE 31

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-32
SLIDE 32

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-33
SLIDE 33

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-34
SLIDE 34

Autocovariance function

15 10 5 5 10 15 s 1.0 0.5 0.0 0.5 1.0 R(s)

slide-35
SLIDE 35

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-36
SLIDE 36

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-37
SLIDE 37

Realization

2 4 6 8 10 12 14 i 3 2 1 1 2 3

slide-38
SLIDE 38

Definition Mean and autocovariance functions Important random processes

slide-39
SLIDE 39

Independent identically-distributed sequences

A discrete random process is iid if

X (i) has the same distribution for any fixed i

X (i1), X (i2), . . . , X (in) are mutually independent for any i1, . . . , in and any n ≥ 2

slide-40
SLIDE 40

Independent identically-distributed sequences

Valid definition

◮ If the state is discrete

p

X(i1), X(i2),..., X(in) (xi1, xi2, . . . , xin) = n

  • i=1

p

X (xi) ◮ If the state is continuous

f

X(i1), X(i2),..., X(in) (xi1, xi2, . . . , xin) = n

  • i=1

f

X (xi)

The process is strictly stationary

slide-41
SLIDE 41

Uniform distribution in [0, 1]

2 4 6 8 10 12 14 i 0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2

slide-42
SLIDE 42

Uniform distribution in [0, 1]

2 4 6 8 10 12 14 i 0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2

slide-43
SLIDE 43

Uniform distribution in [0, 1]

2 4 6 8 10 12 14 i 0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2

slide-44
SLIDE 44

Geometric distribution (p = 0.4)

2 4 6 8 10 12 14 i 2 4 6 8 10 12

slide-45
SLIDE 45

Geometric distribution (p = 0.4)

2 4 6 8 10 12 14 i 2 4 6 8 10 12

slide-46
SLIDE 46

Geometric distribution (p = 0.4)

2 4 6 8 10 12 14 i 2 4 6 8 10 12

slide-47
SLIDE 47

Independent identically-distributed sequences

If the distribution at each time has mean µ and variance σ2 µ

X (i)

R

X (i, j)

slide-48
SLIDE 48

Independent identically-distributed sequences

If the distribution at each time has mean µ and variance σ2 µ

X (i) := E

  • X (i)
  • R

X (i, j)

slide-49
SLIDE 49

Independent identically-distributed sequences

If the distribution at each time has mean µ and variance σ2 µ

X (i) := E

  • X (i)
  • = µ

R

X (i, j)

slide-50
SLIDE 50

Independent identically-distributed sequences

If the distribution at each time has mean µ and variance σ2 µ

X (i) := E

  • X (i)
  • = µ

R

X (i, j) := E

  • X (i)

X (j)

  • − E
  • X (i)
  • E
  • X (j)
  • =
  • σ2

if i = j if i = j

slide-51
SLIDE 51

Gaussian random process

Any set of samples is a Gaussian random vector Fully characterized by mean function µ

X and autocovariance function R X

  • X :=

    

  • X (t1)
  • X (t2)

· · ·

  • X (tn)

     is a Gaussian random vector with mean and covariance

  • µ

X :=

    µ

X (t1)

µ

X (t2)

· · · µ

X (tn)

    Σ

X :=

     R

X (t1, t1)

R

X (t1, t2)

· · · R

X (t1, tn)

R

X (t1, t2)

R

X (t2, t2)

· · · R

X (t2, tn)

. . . . . . ... . . . R

X (t2, tn)

R

X (t2, tn)

· · · R

X (tn, tn)

    

slide-52
SLIDE 52

Generating a Gaussian random process

Boils down to sampling a Gaussian random vector with the appropriate mean and covariance matrix

  • 1. Compute the mean vector

µ

X and the covariance matrix Σ X

  • 2. Generate n independent samples from a standard Gaussian
  • 3. Color the samples according to Σ

X and center them around

µ

X

slide-53
SLIDE 53

Poisson process

Sequential events occurring on [0, ∞)

  • 1. Each event occurs independently from every other event
  • 2. Events occur uniformly
  • 3. Events occur at a rate of λ events per time interval
  • N (t) is the number of events between 0 and t
slide-54
SLIDE 54

Poisson process

For any t1 < t2 < t3 < t4 1. N (t2) − N (t1) is Poisson with parameter λ (t2 − t1) 2. N (t2) − N (t1) and N (t4) − N (t3) are independent A random process satisfying these two conditions is a Poisson process

slide-55
SLIDE 55

Poisson process

nth order distribution can be expressed in terms of p

  • ˜

λ, x

  • :=

˜ λx e−˜

λ

x!

slide-56
SLIDE 56

Poisson process

p

N(t1),..., N(tn) (x1, . . . , xn)

slide-57
SLIDE 57

Poisson process

p

N(t1),..., N(tn) (x1, . . . , xn)

= P

  • N (t1) = x1, . . . ,

N (tn) = xn

slide-58
SLIDE 58

Poisson process

p

N(t1),..., N(tn) (x1, . . . , xn)

= P

  • N (t1) = x1, . . . ,

N (tn) = xn

  • = P
  • N (t1) = x1,

N (t2) − N (t1) = x2 − x1, . . . , N (tn) − N (tn−1) = xn − xn−1

slide-59
SLIDE 59

Poisson process

p

N(t1),..., N(tn) (x1, . . . , xn)

= P

  • N (t1) = x1, . . . ,

N (tn) = xn

  • = P
  • N (t1) = x1,

N (t2) − N (t1) = x2 − x1, . . . , N (tn) − N (tn−1) = xn − xn−1

  • = P
  • N (t1) = x1
  • P
  • N (t2) −

N (t1) = x2 − x1

  • . . . P
  • N (tn) −

N (tn−1) = xn − xn−1

slide-60
SLIDE 60

Poisson process

p

N(t1),..., N(tn) (x1, . . . , xn)

= P

  • N (t1) = x1, . . . ,

N (tn) = xn

  • = P
  • N (t1) = x1,

N (t2) − N (t1) = x2 − x1, . . . , N (tn) − N (tn−1) = xn − xn−1

  • = P
  • N (t1) = x1
  • P
  • N (t2) −

N (t1) = x2 − x1

  • . . . P
  • N (tn) −

N (tn−1) = xn − xn−1

  • = p (λt1, x1) p (λ (t2 − t1) , x2 − x1) . . . p (λ (tn − tn−1) , xn − xn−1)
slide-61
SLIDE 61

Poisson process (λ = 0.2)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-62
SLIDE 62

Poisson process (λ = 0.2)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-63
SLIDE 63

Poisson process (λ = 0.2)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-64
SLIDE 64

Poisson process (λ = 1)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-65
SLIDE 65

Poisson process (λ = 1)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-66
SLIDE 66

Poisson process (λ = 1)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-67
SLIDE 67

Poisson process (λ = 2)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-68
SLIDE 68

Poisson process (λ = 2)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-69
SLIDE 69

Poisson process (λ = 2)

2 4 6 8 10 t 0.0 0.2 0.4 0.6 0.8 1.0

slide-70
SLIDE 70

Call-center data

◮ Example: Data from a call center in Israel ◮ We compare the histogram of the number of calls received in an

interval of 4 hours over 2 months and the pmf of a Poisson random variable fitted to the data

slide-71
SLIDE 71

Call-center data

5 10 15 20 25 30 35 40 Number of calls 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 Real data Poisson distribution

slide-72
SLIDE 72

Poisson process

Distribution of interarrival times? FT (t)

slide-73
SLIDE 73

Poisson process

Distribution of interarrival times? FT (t) := P (T ≤ t)

slide-74
SLIDE 74

Poisson process

Distribution of interarrival times? FT (t) := P (T ≤ t) = 1 − P (T > t)

slide-75
SLIDE 75

Poisson process

Distribution of interarrival times? FT (t) := P (T ≤ t) = 1 − P (T > t) = 1 − P (no events in an interval of length t)

slide-76
SLIDE 76

Poisson process

Distribution of interarrival times? FT (t) := P (T ≤ t) = 1 − P (T > t) = 1 − P (no events in an interval of length t) = 1 − e−λ t

slide-77
SLIDE 77

Poisson process

Distribution of interarrival times? FT (t) := P (T ≤ t) = 1 − P (T > t) = 1 − P (no events in an interval of length t) = 1 − e−λ t fT (t) = λe−λ t Iid exponential sequence (allows to simulate Poisson process!)

slide-78
SLIDE 78

Call-center data

◮ Example: Data from a call center in Israel ◮ We compare the histogram of the inter-arrival times between calls

  • ccurring between 8 pm and midnight over two days and the pdf of an

exponential random variable fitted to the data

slide-79
SLIDE 79

Call center

1 2 3 4 5 6 7 8 9 Interarrival times (s) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Exponential distribution Real data

slide-80
SLIDE 80

Generating a Poisson process

To sample from a Poisson random process with parameter λ we:

  • 1. Generate independent samples from an exponential random variable

with parameter λ t1, t2, t3, . . .

  • 2. Set the events of the Poisson process to occur at t1, t2, t3, . . .
slide-81
SLIDE 81

Mean and autocovariance

E

  • X (t)
slide-82
SLIDE 82

Mean and autocovariance

E

  • X (t)
  • = λ t
slide-83
SLIDE 83

Mean and autocovariance

E

  • X (t)
  • = λ t

R

X (t1, t2) = λ min {t1, t2}

slide-84
SLIDE 84

Mean and autocovariance

E

  • X (t)
  • = λ t

R

X (t1, t2) = λ min {t1, t2}

The process is neither strictly nor wide-sense stationary

slide-85
SLIDE 85

Earthquakes

◮ Earthquakes in San Francisco follow a Poisson process with parameter

0.3 earthquakes/year

◮ Probability of no earthquakes in the next 10 years and then at least 1

  • ver the following 20 years?
slide-86
SLIDE 86

Earthquakes

P

  • X (10) = 0,

X (30) ≥ 1

slide-87
SLIDE 87

Earthquakes

P

  • X (10) = 0,

X (30) ≥ 1

  • = P
  • X (10) = 0,

X (30) − X (10) ≥ 1

slide-88
SLIDE 88

Earthquakes

P

  • X (10) = 0,

X (30) ≥ 1

  • = P
  • X (10) = 0,

X (30) − X (10) ≥ 1

  • = P
  • X (10) = 0
  • P
  • X (30) −

X (10) ≥ 1

slide-89
SLIDE 89

Earthquakes

P

  • X (10) = 0,

X (30) ≥ 1

  • = P
  • X (10) = 0,

X (30) − X (10) ≥ 1

  • = P
  • X (10) = 0
  • P
  • X (30) −

X (10) ≥ 1

  • = P
  • X (10) = 0

1 − P

  • X (30) −

X (10) = 0

slide-90
SLIDE 90

Earthquakes

P

  • X (10) = 0,

X (30) ≥ 1

  • = P
  • X (10) = 0,

X (30) − X (10) ≥ 1

  • = P
  • X (10) = 0
  • P
  • X (30) −

X (10) ≥ 1

  • = P
  • X (10) = 0

1 − P

  • X (30) −

X (10) = 0

  • = e−3

1 − e−6 = 4.97 10−2

slide-91
SLIDE 91

Random walk

Process that evolves by taking steps in random directions Step sequence Z is iid

  • S (i) =
  • +1

with probability 1

2

−1 with probability 1

2

We define a random walk X as

  • X (i) :=
  • for i = 0

i

j=1

S (j) for i = 1, 2, . . .

slide-92
SLIDE 92

Random walk

2 4 6 8 10 12 14 i 6 4 2 2 4 6

slide-93
SLIDE 93

Random walk

2 4 6 8 10 12 14 i 6 4 2 2 4 6

slide-94
SLIDE 94

Random walk

2 4 6 8 10 12 14 i 6 4 2 2 4 6

slide-95
SLIDE 95

First-order pmf

p

X(i) (x) ?

Distribution of number of positive steps S+? Negative steps: S− = i − S+ p

X(i) (x)

slide-96
SLIDE 96

First-order pmf

p

X(i) (x) ?

Distribution of number of positive steps S+? Negative steps: S− = i − S+ p

X(i) (x) = P

 

i

  • j=0
  • S (i) = x

 

slide-97
SLIDE 97

First-order pmf

p

X(i) (x) ?

Distribution of number of positive steps S+? Negative steps: S− = i − S+ p

X(i) (x) = P

 

i

  • j=0
  • S (i) = x

  = P (S+ − S− = x)

slide-98
SLIDE 98

First-order pmf

p

X(i) (x) ?

Distribution of number of positive steps S+? Negative steps: S− = i − S+ p

X(i) (x) = P

 

i

  • j=0
  • S (i) = x

  = P (S+ − S− = x) = P (2 S+ − i = x)

slide-99
SLIDE 99

First-order pmf

p

X(i) (x) ?

Distribution of number of positive steps S+? Negative steps: S− = i − S+ p

X(i) (x) = P

 

i

  • j=0
  • S (i) = x

  = P (S+ − S− = x) = P (2 S+ − i = x) = P

  • S+ = i + x

2

slide-100
SLIDE 100

First-order pmf

p

X(i) (x) ?

Distribution of number of positive steps S+? Negative steps: S− = i − S+ p

X(i) (x) = P

 

i

  • j=0
  • S (i) = x

  = P (S+ − S− = x) = P (2 S+ − i = x) = P

  • S+ = i + x

2

  • =

i

i+x 2

1 2i if i + x 2 is an integer between 0 and i

slide-101
SLIDE 101

Mean and autocovariance

µ

X (i)

slide-102
SLIDE 102

Mean and autocovariance

µ

X (i) := E

  • X (i)
slide-103
SLIDE 103

Mean and autocovariance

µ

X (i) := E

  • X (i)
  • = E

 

i

  • j=1
  • S (j)

 

slide-104
SLIDE 104

Mean and autocovariance

µ

X (i) := E

  • X (i)
  • = E

 

i

  • j=1
  • S (j)

  =

i

  • j=1

E

  • S (j)
  • by linearity of expectation
slide-105
SLIDE 105

Mean and autocovariance

µ

X (i) := E

  • X (i)
  • = E

 

i

  • j=1
  • S (j)

  =

i

  • j=1

E

  • S (j)
  • by linearity of expectation

= 0

slide-106
SLIDE 106

Mean and autocovariance

µ

X (i) := E

  • X (i)
  • = E

 

i

  • j=1
  • S (j)

  =

i

  • j=1

E

  • S (j)
  • by linearity of expectation

= 0 R

X (i, j) = min {i, j}

slide-107
SLIDE 107

Gambler

A fair coin is flipped sequentially Heads: +$1 Tails: -$1 Expected gain?

slide-108
SLIDE 108

Gambler

A fair coin is flipped sequentially Heads: +$1 Tails: -$1 Expected gain?

slide-109
SLIDE 109

Gambler

A fair coin is flipped sequentially Heads: +$1 Tails: -$1 Expected gain? Probability that the gambler is up 6 dollars or more after first 10 flips?

slide-110
SLIDE 110

Gambler

A fair coin is flipped sequentially Heads: +$1 Tails: -$1 Expected gain? Probability that the gambler is up 6 dollars or more after first 10 flips? P (gambler is up $6 or more)

slide-111
SLIDE 111

Gambler

A fair coin is flipped sequentially Heads: +$1 Tails: -$1 Expected gain? Probability that the gambler is up 6 dollars or more after first 10 flips? P (gambler is up $6 or more) = p

X(10) (6) + p X(10) (8) + p X(10) (10)

slide-112
SLIDE 112

Gambler

A fair coin is flipped sequentially Heads: +$1 Tails: -$1 Expected gain? Probability that the gambler is up 6 dollars or more after first 10 flips? P (gambler is up $6 or more) = p

X(10) (6) + p X(10) (8) + p X(10) (10)

= 10 8 1 210 + 10 9 1 210 + 1 210

slide-113
SLIDE 113

Gambler

A fair coin is flipped sequentially Heads: +$1 Tails: -$1 Expected gain? Probability that the gambler is up 6 dollars or more after first 10 flips? P (gambler is up $6 or more) = p

X(10) (6) + p X(10) (8) + p X(10) (10)

= 10 8 1 210 + 10 9 1 210 + 1 210 = 5.47 10−2