Date: Tue, 17 Jan 2006 17:25:24 -0200
Reply-To: Rogerio Porto <rdporto1@TERRA.COM.BR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Rogerio Porto <rdporto1@TERRA.COM.BR>
Subject: Re: AR simulation
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
Dirk,
if you have SAS/IML, you can simulate AR, MA and ARMA processes
through ARMASIM function. For example, to simulate 100 observations
from the following AR(2)
y(t) = (4/3)*y(t-1) + (-8/9)*y(t-2) + e(t)
where e(t) is N(0,0.7), you have:
proc iml;
phi1=4/3;
phi2=-8/9;
phi=1||-phi1||-phi2;
y=armasim(phi,1,0,0.7,100);
create y from y[colname='y'];
append from y;
close y;
quit;
proc print;
run;
I'd rather do this instead of using datasets 'cause IML uses efficient
algorithms.
HTH,
Rogerio.
|