Quadratic Optimisation


nrq
12-16-2005, 11:15 AM
I am just after getting my hands on "Numeric Recipes in C++". I am looking for someone to point me in the right direction or in this section\chapter of the book in order to solve to following problem.

The aim of my problem is to calcuate a set of weights, W_1, W_2, W_3 and W_4.


Given a matrix of data for four indices(I_a, I_b, I_c and I_d) for three months of the year.


| I_a | I_b | I_c | I_d |
==============================
Jan | 2 | 1 | 3 | 2 |

Feb | 3 | -1 | 5 | -2 |

Mar | -4 | 0 | 1 | 1 |
==============================

Given a set of Fund Performances for the same months(Pref_Jan, Pref_Feb and Pref_Mar)

Perf
============
Jan | 4

Feb | -1

Mar | 2
============


Weights: W_1, W_2, W_3 and W_4


p(1) = Perf_Jan-((I_a_Jan * W_1) + (I_b_Jan * W_2) + (I_c_Jan * W_3) + (I_d_Jan * W_4))
p(2) = Perf_Feb-((I_a_Feb * W_1) + (I_b_Feb * W_2) + (I_c_Feb * W_3) + (I_d_Feb * W_4))
p(3) = Perf_Mar-((I_a_Mar * W_1) + (I_b_Mar * W_2) + (I_c_Mar * W_3) + (I_d_Mar * W_4))

Probem: Minimise the Varience of p(0), p(1) and p(2) i.e. Var(p(1), p(2), p(3)) to calculate the values for the four weights - W_1, w_2, w_3 and w_4
such that the total of the weights sums to 1 i.e. W_1 + W_2 + W_3 + w_4 = 1 and a each weight has to be between 0 and 1.

This results in a type of regression problem(i think) or a Quadratic Equation which has to be solved using a Quadratic Optimisation\Programming technique.
I can solve this problem in excel using it's built-in solver. I can post the worksheet on the web if anyone wants to take a look at it.

My aim is to write a program to perform quadratic optimisation on this problem in order to calcuate the four weights.

Can anyone help.