Figure 10.15 (page 605):

Probability density for single particle stochastic growth model at different times.

Code for Figure 10.15

Text of the GNU GPL.

main.m

tfin = 1;
lambda = 10000;
nsim = tfin*lambda;

igrid = 1:nsim;
nts = 5;
p = zeros(nsim,nts);
tvec = linspace(0.1,0.9,nts);
for i = 1:nts
  tau = tfin*tvec(i);
  logp = -lambda*tau +  (igrid-1)*log(lambda*tau) - gammaln(igrid);
  pbig(:,i) = exp(logp);
end
igridbig = igrid;

lambda = 100;
nsim = tfin*lambda;

igrid = 1:nsim;
nts = 5;
p = zeros(nsim,nts);
tvec = linspace(0.1,0.9,nts);
for i = 1:nts
  tau = tfin*tvec(i);
  logp = -lambda*tau +  (igrid-1)*log(lambda*tau) - gammaln(igrid);
  psmall(:,i) = exp(logp);
end
igridsmall = igrid;

figure(1)
plot(igridsmall, psmall) 
table1 = [igridsmall', psmall];

figure(2)
plot(igridbig, pbig)
table2 = [igridbig', pbig];

save "singleparticle.dat" table1 table2