gen_dg.m

Revision 1 - 6/13/07 at 2:27 pm by e2holmes

Back to revision history for gen_dg.m
This file is part of the project Generate stochastic population processes
%simulation of a discrete Gompertz
function x=gen_dg(pars,reps,simlen)
a = pars.a;
b = pars.b;
s2 = pars.s2;
x1 = pars.initx;
dt = 1;
x = -99*ones(reps,simlen);
x(:,1) = x1;
for i = 2:simlen,
    x(:,i) = x(:,i-1)*a + b...
        +randn(reps,1)*sqrt(s2);
end
Sculpin 0.2 | xhtml | problems or comments? | report bugs