Date: Tue, 24 May 2005 17:13:42 -0700 cassell.david@EPAMAIL.EPA.GOV "SAS(r) Discussion" "David L. Cassell" Re: proc mixed model with ar(1) processes inter and intra blocks <20050524234352.21859.qmail@web32202.mail.mud.yahoo.com> text/plain; charset=US-ASCII

I'm going to side with Dale on this one. Mostly. :-)

I agree with Dale that if you want the generated stream to be correct from the first iteration, you need to do this:

u0 = rannor(seed); do i=1 to k; u1 = rho*u0 + sqrt(1-rho*rho)*rannor(seed); output; u0 = u1; end;

This is the formulation that I learned in intro time series courses, back when dinosaurs still ruled the earth. Shiling is writing the time series in a traditional manner, using the duality of AR processes as infinite-order MA processes. But that's not particularly efficient for process generation. It *is* really useful once you start using the backshift operator and you want to do a little theory. I think that Dale's formulation will make the generation process a lot easier once Shiling moves on up to more complex time series models, with higher-order ARIMA(p,d,q) models.

But the idea of 'burn-in' is not new. It's a fundamental part of some statistical tools. The Gibbs sampler comes to mind, for one. So Shiling could make this work. I would recommend a burn-in period of at least M=10 for this case, although the computer cost is so small that there's really no point in not using a burn-in period of, say, M=1000. If Shiling builds a much more complex time series model, he may want to use an M of 100 or so, just to address any long-term hysteresis of his models.

So here's my version of Shiling's code:

u0 = rannor(seed); M = 1000; /* just pick something big enough */ do i=1 to k+M; u1 = rho*u0 + rannor(seed); if i > M then output; u0 = u1; end;

With this sort of minor mod, Shiling's code will do just what he wants.

Just sticking my nose in, David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician

Back to: Top of message | Previous page | Main SAS-L page