[S] A vectorization question

bmehmet (bmehmet@netone.com.tr)
Mon, 12 Oct 1998 23:51:09 +0300


Could any one suggest a vectorization for the second loop in the
following program
please.

e <- rnorm(100)
x <- numeric(100)
x[1] <- e[1]
for(i in 1:200) {
es <- sample(e[2:100], replace=T)
for(i in 2:100) {
x[i] <- .95*x[i-1] + es[i-1]
}
# other calculations
}

--
Mehmet Balcilar, PhD
Assistant Professor
Cukurova University
College of Economics and Administrative Sciences
Department of Economics
P.0. Box 393
Seyhan, Adana 01322
Turkey

Tel: +90 (322) 225-0474 +90 (322) 225-0477 Fax: +90 (322) 228-1699 +90 (322) 225-0088

e-mail: bmehmet@netone.com.tr bmehmet@pamuk.cu.edu.tr

Homepage: http://idari.cu.edu.tr/~mehmet

----------------------------------------------------------------------- This message was distributed by s-news@wubios.wustl.edu. To unsubscribe send e-mail to s-news-request@wubios.wustl.edu with the BODY of the message: unsubscribe s-news