Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2007/iii/paper-73/1/b/solution

For a constant-rate Poisson process, let be the waiting time from a spike to the next spike. By independent increments, there is no spike in an interval of length with probability . Hence, for ,
Its density is , so the interspike intervals are independent exponential distributions with mean . If is uniform on , inverse transform sampling gives . Repeatedly add independent draws to the current spike time to simulate a constant-rate spike train.
For a prescribed time-dependent nonnegative rate , use an Inhomogeneous Poisson process. Conditional on the present event at , its next waiting time has survival probability
Thus its conditional CDF is minus that expression for . Define the cumulative intensity . For each new independent uniform draw, set and solve
This transforms independent unit-rate exponential intervals in integrated-intensity time into physical spike times. Use a generalized inverse when the rate vanishes on an interval: no spikes are placed in a flat part of . On a finite simulation window, stop when the next intensity target exceeds the available . If the total future intensity is finite, a target beyond it means that no further spike occurs.
Numerically, integrate the known rate and invert the accumulated integral, or integrate exactly across piecewise-constant rate bins. Drawing an exponential interval using only is not exact when the rate changes during the interval. The Poisson model also omits the neuronal refractory period and other spike-history effects.

New to topics? Read the docs here!