[R] exponential smoothing

Xavier.Abulker@fimat.com Xavier.Abulker at fimat.com
Fri Jun 14 14:10:58 CEST 2002



could someone help me to write a fonction doing an exponential smoothing in
case of a multivariate time serie?
I tried
ewma <- function (x, lambda = 1, init = 0)
{
     if (is.ts(x))
       filter(lambda*x, filter=1-lambda, method="recursive", init=init)
     else
       stop(message="first argument should be a time serie")
}
but I can't apply that to multivariate
Thanks

xavier


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list