[R] How to use filter function for this?
Farhat Iqbal
takkari at hotmail.co.uk
Mon May 28 15:37:16 CEST 2007
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
More information about the R-help
mailing list