Raw Message
Message-ID: <opshd540gwz5jgoz@muller>
Date: 2004-11-13T07:08:50Z
From: James Muller
Subject: unavoidable loop? a better way??
In-Reply-To: <4195AE2E.D73BFBC0@columbia.edu>
I am very sorry. I've made a typo. The function should be:
# p is a vector
myfunc <- function (p) {
x[1] <- p[1]
for (i in c(2:length(p))) {
x[i] <- 0.8*p[i] + 0.2*x[i-1]
}
return (x)
}
James