search for: returnsfrominception

Displaying 1 result from an estimated 1 matches for "returnsfrominception".

2007 Mar 16
1
cumsum over varying column lengths
...date i and equity j. I also have a matrix startOffset, where entry (1, k) is the row offset in historicalReturns where I entered into equity k. So we have that NCOL(startOffset) = NCOL(historicalReturns). Now I would like compute for each column in historicalReturns, the cumulative return 'returnsFromInception' for the equity starting from the startOffset date. Is there a better way than as follows: n <- NROW(historicalReturns) returnsFromInception <- matrix(nrow = 1, ncol = NCOL(historicalInceptionDates)) for (i in 1 : NCOL(historicalReturns)) { cumReturn <- cumsum(historicalRetur...