# Maximizing the ratio of (weigthed sum)/sqrt(variance_weighted_sum)

I have a weighted sum,

weighted sum = w1*mu1 + (1-w1)*mu2

with

variance weighted sum = (w1^2)*var1 + ((1-w1)^2)*var2 + 2*w1*(1-w1)*cov

in which

mu1 = mean 1; mu2 = mean 2; var1 = variance for mean 1; var2 = variance for mean 2; cov = covariance; w1 = weight (ranging from 0 to 1)

Even though I can compute easily the minimum variance, I am now interested in finding the w1 that gives the largest ratio (weighted sum)/sqrt(variance_weighted sum).

Do you have any ideas on how one could do that? Any references?

Tiago

*/

Many thanks, Robert! Does your solution take into account that the denominator is the square root of var_weighted_sum? and that the ratio may be either positive or negative? Actually, I am looking for the largest absolute ratio.

The formulation seems to provide weights that do not give the largest ratio. Example:

mu1 = 0.8125358 mu2 = 0.1312268

var1 = 0.123922 var2 = 0.010128

cov = 0.0021274

I know that for this example, the weight (w1) that gives the highest ratio R

where

R = (w1*mu1 + (1-w1)*mu2)/sqrt((w1^2)*var1 + ((1-w1)^2)*var2 + 2*w1*(1-w1)*cov)

is w1 = 0.354, giving a R = 2.5867

According to your solution, the w1 = 0.0795, giving a R = 1.885

Since my background is in Biosciences, I will be really grateful if you could comment on that. Am I doing something wrong?

It's easy enough to take the derivative and solve for that = 0. The result I get is $w_1 = \frac{\mu_2 cov - \mu_1 var_2}{(\mu_1+\mu_2) cov - \mu_1 var_1 - \mu_2 var_2}$. This critical point is not necessarily in the interval $[0,1]$ and might be a minimum or inflection rather than a maximum, so the maximum might be here or at 0 or 1. It's also possible that there is no maximum because the variance weighted sum is 0 at some point.
• Oops: typo. That should be $w_1 = \frac{\mu_2 cov - \mu_1 var_2}{(\mu_1 + \mu_2) cov - \mu_1 var_2 - \mu_2 var_1}$ – Robert Israel Apr 22 '11 at 19:52