How to calculate weight to minimize variance?

Viewed 1182

given several vectors:

x1 = [3 4 6]
x2 = [2 8 1]
x3 = [5 5 4]
x4 = [6 2 1]

I wanna find weight w1, w2, w3 to each item, and get the weighted sum of each vector: yi = w1*i1 + w2*i2 + w3*i3. for example, y1 = 3*w1 + 4*w2 + 6*w3 to make the variance of these values(y1, y2, y3, y4) to be minimized.

notice: w1, w2, w3 should > 0, and w1 + w2 + w3 = 1

I don't know what kind of problems it should be... and how to solve it in python or matlab?

4 Answers
Related