# test OU.gensim - from Zivot page 764 kappa = .4; theta = .08; sigma = .1 sim.ou = OU.gensim(rho = c(kappa, theta, sigma), n.sim = 1000, n.burn = 500, aux = OU.aux(X0 = .1, ndt = 25, seed = 1, t.per.sim = 1/52)) tsplot(sim.ou) abline(h=theta) # test CIR.gensim - from Zivot page 766 kappa = .4; theta = .08; sigma = .1 rho = c(kappa, theta, sigma) ndt = 25; n.sim = 1000; n.burn = 500 set.seed(1) z = rnorm(ndt*(n.burn + n.sim)) sim.cir = CIR.gensim(rho = rho, n.sim = n.sim, n.burn = n.burn, aux = CIR.aux(X0 = theta, ndt = ndt, z = z, t.per.sim = 1/52)) # Plot the simulation tsplot(sim.cir) # Plot the long-run mean abline(h=theta)