[R-SIG-Finance] Applying quarterly weights on daily returns

Murali Menon feanor0 at hotmail.com
Mon Jun 9 18:19:55 CEST 2008



Folks, 

I have quarterly weights (4 quarters) and 300 days of daily trading signals and returns for 3 assets. 

library(zoo) 
set.seed(123) 

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?

Please advise. 

Thanks, 

Murali
_________________________________________________________________
Instantly invite friends from Facebook and other social networks to join yo
https://www.invite2messenger.net/im/?source=TXT_EML_WLH_InviteFriends


More information about the R-SIG-Finance mailing list