Mark Knecht markknecht at gmail.com
Fri Feb 11 16:55:10 CET 2011

```On Wed, Feb 9, 2011 at 3:38 PM, Brian G. Peterson <brian at braverock.com> wrote:
> On 02/09/2011 05:09 PM, Mark Knecht wrote:
<SNIP>
>> I'd like to take this to the next level where I pick a group of 5 that
>> has the lowest overall correlation, and a second group of 5 that has
>> the highest overall correlation. From that I'll calculate an aggregate
>> equity curve and then look at things like ROA on the totals as a way
>> to evaluate how I feel about the groups.
>>
>> QUESTION:
>> How can I find the 5 systems in the correlation matrix that when
>> summed together again all possible combinations of the 5 gives me the
>> largest or smallest value?
>
> I would ask a different question.
>
> I assume that the P&L distribution of your strategies is not normally
> distributed, so minimizing covariances would also minimize positive skew,
> which is likely not the outcome that you want.
>
> Here's a simplified/modified version of a process I've used in the past to
> choose among 'similar' systems (in this case similar in all operating on the
> same market).
>
> 1. first eliminate the ones with 'bad' performance based on criteria you set
> (drawdowns, worst day, percent winning/losing days, etc.)
>
> 2. take your two 'best' performers.  this may be just P&L or may be in
> combination with other statistics.
>
> 3. pick the other 3 by looking for low/inverse correlations to your two
> best, or alternately just pick the five best
>
> 4. run a portfolio optimization to decide 'how much' to allocate to each
> system.  I use an objective like 'maximize return subject to minimizing
> drawdowns and minimizing risk concentration (component ES) while keeping my
> total drawdown and 1-day (95%, 1 in 20, about 1 day per month) ES below a
> specific threshold.
>
> 5. trade your five systems using those portfolio weights converted backwards
> to maximum position sizes.
>
> If you have the capital, I'd skip steps 2 & 3 entirely, and let the
> optimizer decide 'how much'.
>
> Regards,
>
>  - Brian

Brian,
Thanks for the detailed response. It's good info and if I was
building a portfolio of these systems to trade then I'd likely do
something similar.

None the less, off of StackOverflow I received a nice enough
solution, shown below in case it helps others looking for similar
solutions. (I take no credit other than for asking the question.) ;-)

Cheers,
Mark

x<-matrix(runif(100),10,10)
cor<-cor(x)
l <- length(cor)
l1 <- length(cor[cor<1])

#the actual high and low correlation indexes
corHigh <- order(cor)[(l1-4):l1]
corLow <- order(cor)[1:5]
#(if you just want to view the correlations cor[corLow] or
cor[corHigh] works fine)

#isolate them in the matrix so you can see where they came from easily
corHighView <- cor
corHighView[!1:l %in% corHigh] <- NA
corLowView <- cor
corLowView[!1:l %in% corLow] <- NA

#look at your matrix with your target correlations sticking out like a
sore thumb
options(digits=2)
cor

corLowView

corHighView

```