Re: [R] moving correlation coef ?

From: <davidr_at_rhotrading.com>
Date: Thu 30 Jun 2005 - 03:56:00 EST

One common weighting scheme is exponentially weighted, i.e., wt = L^(0:m) ,
where 0 < L <= 1 .

David L. Reiner

p.s.
If your question is coming from a financial application, you might be interested in the R-sig-finance list, as well as reading the RiskMetrics (r)
document "Return to RiskMetrics: The Evolution of a Standard", by Jorge
Mina and Jerry Yi Xiao (available at their site, after a free registration) where exponentially weighted moving statistics are discussed at length.

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch [mailto:r-help-
> bounces@stat.math.ethz.ch] On Behalf Of vincent
> Sent: Wednesday, June 29, 2005 11:02 AM
> Cc: r-help@r-project.org
> Subject: Re: [R] moving correlation coef ?
>
> Thank you for your answers.
>
> In fact, i believe my question wasn't precise enough.
> I don't want to have a moving/sliding windows over the data
> to correlate (i am already doing that).
>
> If I have 2 vectors
> X = (x1, x2, x3, ..., xt)
> Y = (y1, y2, x3, ..., yt)
> I want the most recent elements (t) to have a heavier weight
> in the correlation calculus than the older ones (1).
>
> I think that one simple way to do that is for example to
> compute cor() over XP, YP where
> XP = (x1, x2, x2, x3, x3, x3, ..., xt, xt, xt)
> YP = (y1, y2, y2, y3, y3, y3, ..., yt, yt, yt)
> ie where each element is repeated several times according
> to its freshness.
> It's quite naive ! so if there is a cleaver idea, many thanks.
>
> Thanks
> Vincent
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-
> guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 30 04:01:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:07 EST