Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

Maximize out-of-sample correlation

$
0
0

Say I have one time-series A of interest, and 10 other time-series B at hand. Then, I pick 3 time-series of the B group, average them, and predict an out-of-sample correlation with time-series A. The goal is to optimize the selection such that the aggregated time-series B selection maximizes the out-of-sample correlation.

Some toy data:

A <- ts(rnorm(1000 + 100, 0, 0.05))
A.in <- ts(A[1:1000])
A.out <- ts(A[1001:1100]) ## this is the out-of-sample period

B <- ts(matrix(rnorm((1000 + 100) * 10, 0, 0.05), (1000 + 100), 10))
B.in <- ts(B[1:1000, ])
B.out <- ts(B[1001:1100, ]) ## this is the out-of-sample period

Currently I have some code that is able to determine which 3 aggregated time-series B maximize the correlation within the "in-sample" data. I started to work on the out-of-sample issue using vector autoregression, but I get stuck.

I was hoping to get some insights in a better way of coding this issue.


Viewing all articles
Browse latest Browse all 201919

Trending Articles



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