Dear R users, Iâd like to create a function as: Y.t+1 = Y.t + (1\p)*summation(x(Y.t,Y.t-1,...)) + epsilon.t
where x is a function of Y.t, Y.t-1 and so on, epsilon is a random error and p is a parameter. Do you think something of the following form might be appropriate? Y<-function(Y,p,x,epsilon){ for (i in 2:length(Y)) { Y[i]<-Y[i-1]+(1/p)*sum(x(Y[i-1]))+epsilo.t} Y } Any indication is warmly appreciated. thanks and best regards [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.