[R-SIG-Finance] (no subject)

Gultekin Isiklar gisiklar at gmail.com
Thu Oct 2 13:49:43 CEST 2008


After using various software packages, I have recently started using R and 
I am especially impressed with its succinct syntax. 
I am at the very early stages of using it so I hope the following question 
is not very off.
What is the easiest way of creating a simulated series like
y(t)=a0+a1*y(t-1)+err(t)

I can do this using a for loop after using something like 
y = numeric (100)
err =rnorm(100,mean =0, sd =1)
for (t in 2:100{
y [t] = 1+0.9*y [t-1]+err [t ]
}
but I was wondering if there is a simpler way of doing this in R without 
using a for loop.
Thanks,
Gultekin

___
Sent from AT&T Wireless



More information about the R-SIG-Finance mailing list