Hi, I have the following problem. I think it boils down to a graph fitting, quadratic_opitimisation problem(I think). Please take a look.

I have two tables.

Table One:

M F1 F2 F3
Jan 2 0 -3
Feb -3 1 2
Mar -1 3 0

Table Two:

M Performance
Jan 2
Feb -1
Mar 0

Giving the following formula:

S(0) = JanPerformance - (X1 * JanF1) + (X2 * JanF2) + (X3 * JanF3)
S(1) = FebPerformance - (X1 * FebF1) + (X2 * FebF2) + (X3 * FebF3)
S(2) = MarPerformance - (X1 * MarF1) + (X2 * MarF2) + (X3 * MarF3)

I have each of the F's(JanF1, FebF1 ...etc.), taken form the tables above but I need to calculate the value of X1, X2, X3 and S(0),S(1) and S(2) such that we Minimise the Variance of S(0), S(1) and S(2).

In summary calculate the three x's such that we minimise Variance(S(0), S(1), S(3)).

There are constraints on the unkonwn X's:

All 3 x's must be between 0 and 1.
The 3 x's must sum to a total of 1. i.e. x1 + x2 + x3 =1.

I know this is a simple problem for the excel solver(I can mail you the spreadsheet with the problem worked out) but I need to produce an algorithm to solve it as I intend to code a solver of my own.

I've uploaded the Excel doc here: