[R] How to use filter function for this?

Farhat Iqbal
Mon, 28 May 2007 13:37:16 -0000

Hello,

I have been trying to compute the following:

for(t in 3:n){

		h[t]<-(omegac/(1-betac))+alphac*Y[t-1]

		b[t]<-Y[t-1]
		bb[t]<-0

		for(j in 2:(t-1)){
				h[t]<-h[t]+alphac*((betac)^(j-1))*Y[t-j]
				b[t]<-b[t]+((betac)^(j-1))*Y[t-j]
				bb[t]<-bb[t]+((betac)^(j-2))*Y[t-j]*(j-1)
				}
               }


but it takes a long time. I have heard that "filter" function can be
used
instead but dont know how to apply it. Did anyone use it and have any idea
how to apply for this function?.
Thanks

_________________________________________________________________
Could you be the guest MSN Movies presenter? Click Here to Audition