Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11601

issue with rolling correlations in R

$
0
0

I want to measure rolling correlations between 2 vectors. If I choose a window width and I measure the correlations, most of the commands will add this correlation not in the center of the window, but at the end.

For example, if the window width is 9, the first correlation coefficient will be in the 9th row. However, the coefficients measured reflects the correlation on average during the window, so that the coefficient should be in the 5th row.

Does anyone know a command (or a package) that would allow me to center the result, because manually it often becomes hard to adjust correctly with the dates.


Viewing all articles
Browse latest Browse all 11601

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>