[R-SIG-Finance] Applying quarterly weights on daily returns
feanor0 at hotmail.com
Mon Jun 9 18:19:55 CEST 2008
I have quarterly weights (4 quarters) and 300 days of daily trading signals and returns for 3 assets.
wts <- abs(zoo(matrix(rnorm(36), ncol = 3), yearqtr(1970 + (0 : 3) / 4)) )
rets <- zoo(matrix(rnorm(900), ncol = 3) / 100, order.by = as.Date(1 : 300))
tsig <- zoo(rbinom(300, 2, 0.5) - 1, order.by = as.Date(1 : 300))
In each quarter, the return would be like:
rowSums(head(tsig, -1) * tail(rets, -1) * wts(of that quarter))
Where the trading signal is applied today, but its return is observed tomorrow.
How to apply quarterly series on a daily series, though?
Instantly invite friends from Facebook and other social networks to join yo
More information about the R-SIG-Finance