Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Review of PROBABILITY DISTRIBUTIONS Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 1 Probability distribution Probability that a (continuous) random variable X is in (x,x+dx). ( P x < X < x + dx ) 0.8 Probability density function (PDF). P ( x < X < x + dx ) f ( x ) = lim dx→+0 dx ( () ) P x < X < x + dx ≈ f x dx Cumulative distribution function (CDF) = Life time distribution. () ( ) ∫ F x =P X ≤x = x −∞ () f s ds Survival function = Complementary CDF. () ( PDF Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG gamma distrib. 0.4 0.2 0 X 0 2 4 6 CDF 1 0.8 0.6 0.4 0.2 ∞ ) ∫ f ( s) ds = 1− F ( x) F x =P X >x = 0.6 x 0 0 2 4 6 Poisson process 2 The fundamental theorem of calculus The relation between probability distribution and probability density function. () ∫ F x = x −∞ () f s ds d d" x % F x = $ ∫ f s ds' = f x & dx dx # −∞ () Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG () () Poisson process 3 Probability distribution: Example Exponential distribution Probability density function (PDF). f x = λe−λx Cumulative distribution function (CDF). F x = P X ≤ x = 1− e − λ x Survival function. F x = P X > x = 1− F x = e − λ x () () ( () ) ( ) () 1.0 0.8 0.6 0.4 0.2 1 Expectation E !" X #$ = λ −1 Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG 2 3 4 5 −2 Variance var !" X #$ = λ Poisson process 4 Samples from a distribution PDF 0.8 0.6 gamma distrib. 0.4 If a random variable X follows a cdf FX, then the r.v. U given by ( ) ∫ U = FX X = X −∞ f X () fX x 0.2 0 X 0 ( s) ds follows an uniform distribution in [0,1]. 2 4 6 CDF 1 U 0.8 () FX x 0.6 0.4 0.2 0 Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG 0 2X 4 6 Poisson process 5 Homework 1-1 Problem ( ) Confirm that U = FX X follows an uniform distribution in [0,1]. () ∫ when X is a random variable from FX x = x 0 () f X s ds Hint Suppose a random variable (r.v.) X given by a pdf f X ( x ) Consider a r.v. Y that is transformed from X using a monotonic function g. Y = g ( X ) The distribution of Y is given as () () fY y = f X x dx = f X x g! x dy () () () () ∫ Consider a particular relation given by CDF, g x = FX x = Then we obtain fY ( y ) = f X ( Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG ) () x g! x −1 () () = fX x fX x −1 x −∞ −1 () f X s ds =1 Poisson process 6 Samples from a distribution CDF Inverse function method 1 Let U be an uniform r.v.. X X that satisfiesU = ∫ −∞ f X s ds follows the density f X x . () The r.v. X = F −1 (U ) () follows the CDF given by F. Exponential distribution: 0.8 0.6 0.4 0.2 0 0 2 4 6 f X x = λe−λx () ( ) ∫ U = FX X = X λ e − λ s ds = 1− e − λ X −∞ A r.v. that follows an exponential distribution with rate λ is generated using an uniform r.v. X as ( ) ( ) X = FX−1 U = −λ −1 log U Memo: The distribution that can be inverted analytically is limited, e.g., Exp., Weibull, Pareto, etc. For other distributions, one can numerically compute CDF to obtain X. Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 7 Introduction to POISSON POINT PROCESS Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 8 Memoryless process A point process is memoryless if intervals X satisfy P ( X > s + t | X > t ) = P ( X > s) Question. Suppose that you bought a refrigerator t years ago. It still works well. How long will it continue to work from now? Event s 0 t t+s X Answer. We wish to know the probability that the refrigerator survives another s years given that it survived t years. This is given as P X > s + t | X > t . ( ( ) ) From the memoryless property, it is equivalent to P X > s . Thus, the fact that the refrigerator survived t years did not provide any information to predict a failure of the refrigerator in future. Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 9 Exponential distribution Q. What distribution possesses the memoryless property? Ans. The exponential distribution: f x = λe−λx () The survival function can be written in a conditional form as ( ( ) ) ( P X > s+t = P X > s+t | X > t P X > t ) Using the memoryless property, we obtain ( ( ) ) ( P X > s+t = P X > s P X > t ) The exponential distribution satisfies the memoryless property. ( ) ( If P X > x = e − λ x , then P X > s P X > t = e ( ) ) − λ s − λt e = e − λ ( s+t ) = P X > s + t Density is given as d f x = − P X > x = λe−λx dx () ( ) ( ) Poisson point process If intervals of events are samples from the exponential distribution, and the intervals are independent each other, then the process is memoryless. This process is called a (homogeneous) Poisson point process. Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 11 Simulating a Poisson process Question. How can we simulate a Poisson point process? Ans. Use the inverse function method to generate an inter-spike interval (ISIs) that follows an exponential distribution. 1.0 0.8 0.6 0.4 ISI X = −λ logU −1 0.2 1 Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG 2 3 4 5 Poisson process 12 The Poisson distribution Let’s consider a distribution of the number of spikes that occurred in T[s]. N T : the number of spikes that happens in T [s] 1 2 N T -th spike 3 T A count distribution of a Poisson point process is given by a Poisson distribution. 0.35 Ê Ê 0.30 ( P NT = n ) λT ) ( = n n! 0.25 e − λT 0.20 Ê 0.15 ‡ Ï ÏÏ Ï ‡ Ï Ê ‡ ‡ ÏÏÏ Ï Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG ‡ ‡ 0.10 0.05 ‡ ‡ Ï Ê Ï Ï Ï Ï ‡ ‡ Ï Ï ÏÏ ‡ Ê Ê Ê Ê Ê Ê ‡ ‡ Ê ‡ Ï ‡ Ï ‡ Ï Ê ‡ Ê ‡ Ê ‡ Ê ‡ Ê Ê Ê Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ï Ê ‡ Ê 5 10 15 20 25 30 Poisson process 13 Homework 1-2 Derive the Poisson distribution for the first few spike counts, N T = 0,1,2. Problem Hint NT = 0 If there is no spike in T, then the first spike occurred after T. This is given by survival function of an exponential distribution. X1 T X2 NT = 1 T s1 NT = 2 X3 s1 s2 T Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG ( ) ( ( ) ) P NT = 0 = P X 1 > T = F T Let the first spike occurred at s_1, the first ISI follows an exponential density, the second ISI should be greater than T-s_1. T P N T = 1 = ∫ f s1 F T − s1 ds1 ( ) ( ) ( 0 ) Similarly if you have two spikes in T, T T ( ) ∫ ∫ f (s ) f (s P NT = 2 = 0 s1 1 2 ) ( ) − s1 F T − s2 ds1 ds2 Poisson process 14 The Erlang distribution Let’s consider a distribution of a waiting time τ until spikes occurred n times. 1 2 3 n-th spike τ Waiting time of multiple spikes from a Poisson process is given by an Erlang distribution. 0.4 0.3 λ nτ n−1 − λτ P (τ < X < τ + d τ ) = e dτ (n −1)! 0.2 0.1 2 Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG 4 6 8 10 12 14 Poisson process 15 Spike count and ISI The relation between a Poisson and Erlang distribution. 1 2 3 n-1 n N τ spikes τ Sn If Sn > τ , the number of spikes in is at most n-1. ( ( ) P N τ < n = P Sn > τ ) Rhs is a survival function of an Erlang distribution. P ( Sn > τ ) = ∫ ∞ τ n−1 n n−1 − λt λ t e dt = ∑ k=0 ( λτ ) k! k e− λτ P ( N τ = n ) = P ( N τ < n +1) − P ( N τ < n ) Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG ( λτ ) = n! n e− λτ Poisson process 16 Instantaneous spike rate Alternative definition of a Poisson point process Divide T into small N bins of a small width Δ (T=NΔ). Spike t Δ t+Δ Instantaneous spike rate P ( a spike in [t, t + Δ)) = λΔ + o ( Δ ) P (> 1 spikes in [t, t + Δ)) = o ( Δ ) P ( no spikes in [t, t + Δ)) = 1− λΔ + o ( Δ ) o (Δ) lim =0 o ( Δ ) is a function that approaches to zero faster than Δ : Δ→+0 Δ Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 17 Relation to the Poisson distribution The probability of a spike/no spike is an approximation of the Poisson distribution for a small time bin. The spike count in a small bin is approximated as ( ) P NΔ = n = (λΔ) n n! e − λΔ = (λΔ) n # & 2 1 1− λ Δ + λ Δ + % ( n! $ 2 ' ( ) In particular, # & 2 1 P N Δ = 0 = 1%1− λΔ + λΔ +( = 1− λΔ + o Δ 2 $ ' # & 2 1 P N Δ = 1 = λΔ %1− λΔ + λΔ +( = λΔ + o Δ 2 $ ' & 2# 2 1 P N Δ = 2 = λΔ %1− λΔ + λΔ +( = o Δ 2 $ ' ( ) ( ) ( ) ( ) Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG ( ) ( ) ( ) ( ) ( ) ( ) Poisson process 18 Exponential / Poisson distribution revisited The exponential distribution from an instantaneous spike rate. The probability that no spikes happened in N-1 bins and a spike happened in the last bin (geometric distribution). (x=NΔ) P ( x < X < x + Δ ) = (1− λΔ ) ISI distribution: f ( x ) = lim Δ→0 N−1 λΔ + o ( Δ ) P ( x < X < x + Δ) = λ e− λ x Δ The Poisson distribution from an instantaneous spike rate. The probability that n spikes happened in N bins (T=NΔ). n ! N $ λ T ) − λT N−n n ( P ( NT = n) = # e as Δ → 0 & (1− λΔ ) ( λΔ ) → n! " n % Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 19 Exponential distribution revisited We can derive the exponential distribution from an instantaneous spike rate, λ [spike/sec] Divide T into small N bins of a width Δ. Probability N bins Spike Δ a spike in a bin: λΔ >2 spikes in a bin: o (Δ) no spikes in a bin: 1− λΔ + o ( Δ ) T = NΔ The probability that no spikes happened in N-1 bins and a spike happened in the last bin. P ( x < T < x + Δ ) = (1− λΔ ) ISI distribution: f ( x ) = lim Δ→0 Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG N−1 λΔ + o ( Δ ) P ( x < T < x + Δ) = λ e− λ x Δ Poisson process 20 Poisson distribution revisted We can derive the Poisson distribution from an instantaneous spike rate, λ [spike/sec] Divide T into small N bins of a width Δ. Probability N bins Δ T = NΔ Spike a spike in a bin: λΔ >2 spikes in a bin: o (Δ) no spikes in a bin: 1− λΔ + o ( Δ ) The probability that n spikes happened in T [s]. n ! N $ λ T ) − λT N−n n ( P ( NT = n) = # e as Δ → 0 & (1− λΔ ) ( λΔ ) → n! n " % Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 21 Homework 1-3 Problem The probability that no spikes happened in N-1 bins and a spike happened in the last bin is given as λΔ N−1 N P ( x < X < x + Δ ) = (1− λΔ ) λΔ + o ( Δ ) = (1− λΔ) + o (Δ) 1− λΔ Show that the ISI distribution becomes an exponential distribution. Hint Approximate the terms by the Taylor expansions. 1 2 1 3 log 1− x = −x − x − x 1 ( ) = 1+ x + x 2 + x 3 2 3 1− x N (1− λΔ) = exp #$ N log (1− λΔ)%& λΔ 2 # ' *% = λΔ 1+ λΔ + ( λΔ ) + 1 2 = exp N − λ Δ − λ Δ − ( +. ( ) 1− λΔ ,& 2 $ ) = λΔ + o ( Δ ) / 1 2 = e− λ x 11− λ 2 xΔ +4 0 2 3 Hence we obtain P ( x < X < x + Δ) f x = lim = λ e− λ x P ( x < X < x + Δ ) = λΔ exp [−λ x ] + o ( Δ ) , and ( ) Δ→0 Δ { Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG } Poisson process 22 Homework 1-4 Problem Probability that n spikes occur in N bins (T [s]) is given as ! N $ n N−n P ( NT = n) = # & ( λΔ ) (1− λΔ ) " n % Show that the probability becomes the Poisson distribution for large N and small Δ with a relation given by a constant T=NΔ. Hint Using an approximation given by the Taylor expansions (See previous slides). n # λΔ & N! N! N n P ( NT = n) = λΔ ) exp [−λΔN ] % ( (1− λΔ ) ≈ ( ( N − n)!n! $ 1− λΔ ' ( N − n)!n! Use the relation, T=NΔ, to obtain N! 1 n P ( NT = n) = λ T exp [−λT ] ( ) n ( N − n)!N n! Use the Stirling’s formula ln N! ~ N ln N − N N " n% " n% N! −n and prove that ln = $1− ' ln $1− ' − n = 1⋅ ln e − n → 0 n ( N − n)!N # N & # N & Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 23 Likelihood function t1 Likelihood function t2 tn 0 T p (t1, t2 ,…, tn ∩ N T = n ) = λ n exp [−λT ] Proof p (t1, t2 ,…, tn ∩ N T = n ) Δ n n = f (t1 ) Δ∏ f (ti − ti−1 ) Δ ⋅ P (tn+1 > T | tn ) i=2 n = λ exp (−λ t1 ) Δ∏ λ exp &'−λ (ti − ti−1 )() Δ ⋅ exp &'−λ (T − tn )() i=2 = λ n Δ exp [−λT ] Here the ISI distribution is f ( x ) = λ exp [−λ x ] Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 24 INHOMOGENEOUS POISSON PROCESS Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 25 Inhomogeneous Poisson process Instantaneous rate λ (t ) Point process t t+Δ P ( a spike in [t, t + Δ)) = λ (t ) Δ + o ( Δ ) Time-dependent rate Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 26 Inhomogeneous Poisson process Instantaneous rate λ (t ) Point process ti−1 ti t # f (t | ti−1 ) = λ (t ) exp %− ∫ λ (u) du&( $ ti−1 ' for t > ti−1 Note that the above formula extends the exponential ISI of homogeneous Poisson process. Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 27 Homework 1-5 Problem Derive the ISI density of the inhomogeneous Poisson process. Hint Let the last spike occurred at time 0. The probability of a spike occurrence in [t, t+Δ) is given as N−1 P ( t < X < t + Δ ) = ∏ #$1− λ ( kΔ ) Δ%& ⋅ #$λ ( NΔ ) Δ%& + o ( Δ ) k=1 N λ ( NΔ ) Δ = ⋅ ∏ #$1− λ ( kΔ ) Δ%& + o ( Δ ) 1− λ ( NΔ ) Δ k=1 Using the following approximation, #N % #N % # % ∏$1− λ (kΔ) Δ& = exp)∑ log {1− λ (kΔ) Δ}* = exp)∑{−λ (kΔ) Δ + o (Δ)}* $ k=1 & $ k=1 & k=1 λ ( NΔ ) Δ = λ ( NΔ ) Δ + o ( Δ ) 1− λ ( NΔ ) Δ t P (t < X < t + Δ ) % ( f t = lim = λ t exp − λ u du ( ) ( ) ( ) The ISI density is given as '& ∫ 0 *) Δ→0 Δ N Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 28 Likelihood function λ (t ) Likelihood function 0 T t1 tn t2 n T % p (t1, t2 ,…, tn ∩ N T = n ) = ∏ λ (ti ) exp '− ∫ λ (u) du(* & 0 ) i=1 n Proof p (t1, t2 ,…, tn ∩ N T = n ) Δ = f (t1 ) Δ∏ f (ti | ti−1 ) Δ ⋅ P (tn+1 > T | tn ) n i=2 n T ' = ∏ λ (ti ) Δ exp )− ∫ λ (u) du*, ( 0 + i=1 ti # & Here the ISI distribution is given as f (ti | ti−1 ) = λ (ti ) exp %− ∫ λ (u) du( $ ti−1 ' Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 29 What we learned 1 2 3 4 5 6 • Memoryless property of a process. • Exponential distribution = Poisson process. • Poisson count distribution, Waiting time distribution (Erlang). • Definition of a Poisson process using instantaneous firing rate. • Exponential and a Poisson count distribution revisited. • Inhomogeneous Poisson process: ISI distribution and likelihood Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 30 Tomorrow, we will learn 1 2 3 4 5 • Renewal process: Conditional intensity function and ISI density. • non-Poisson process (Point process written by the conditional intensity function) • Time-rescaling theorem • How to simulate a point process via the time-rescaling theorem. • How to assess a point process model via the time-rescaling theorem. (Q-Q plot and K-S test) Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 31 Follow-up from the lecture feedback Stimulus signal x (t ) Tomorrow’s topic. Today’s topic. Instantaneous spike-rate λ (t ) Point process t t+Δ P ( a spike in [t, t + Δ)) = λ (t ) Δ + o ( Δ ) Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 32 Likelihood function Density function An observed sample f ( x ) = λ e− λ x X Likelihood function L ( λ ) = f ( X ) = λ e− λ X Multiple observation X1, X 2 ,, X n n Likelihood function L ( λ ) = ∏ p ( Xi | λ ) i=1 Maximum likelihood estimation (MLE) n λMLE = argmax ∏ p ( Xi | λ ) λ Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG i=1 Poisson process 33 Likelihood of a Poisson process Likelihood function of a homogeneous Poisson process Inter-spike Intervals (ISIs) p (t1, t2 ,…, tn ∩ N T = n | λ ) = p (t1, t2 − t1,…, tn − tn−1 ∩ N T = n ) n f (ti − ti−1 ) = λ e − λ (ti −ti−1 ) = ∏ f (ti − ti−1; λ ) ⋅ F (T − tn ; λ ) i=1 = λ n exp [−λT ] Likelihood function of a inhomogeneous Poisson process p (t1, t2 ,…, tn ∩ N T = n | λ0:T ) = p (t1, t2 − t1,…, tn − tn−1 ∩ N T = n ) n ti # f (ti − ti−1 ) = λ (ti ) exp %− ∫ λ (u) du&( $ ti−1 ' = ∏ f (ti − ti−1; λti :ti−1 ) ⋅ F (T − ti ; λtn :T ) i=1 n T & = ∏ λ (ti ) exp (− ∫ λ (u) du)+ ' 0 * i=1 Hideaki Shimazaki, Ph.D. http://goo.gl/viSNG Poisson process 34