Figure 5.6:

A sample path of the unit Poisson process.

Code for Figure 5.6

Text of the GNU GPL.

main.m


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
nsam = 11;

rand("seed", 10)

p = rand(nsam,1);
tau = -log(p);
time = [0; cumsum(tau)];

Y = 0:nsam;

figure()
[xx,yy] = stairs(time, Y);
xx(end) = [];
yy(end) = [];


figure()
hist(tau,20)

table = [xx,yy];
save unitpoisson.dat table