Displaying 1 result from an estimated 1 matches for "oldsplus".
Did you mean:
alzsplus
2006 Dec 11
1
behavior of ewma function
I have the ewma function as shown below. I think I copied it from an
oldSplus help page on filter and
then modified it with a lot of help from Achim.
ewma<-function(x,lambda = 1, init = x[1]) {
rval<-filter(lambda*coredata(x),filter=(1-lambda),method="recursive",ini
t=init)
rval<-zoo(coredata(rval),index(x))
rval
}
It sort of works but , if there are NA...