Double summation with multiplication

7 ビュー (過去 30 日間)
Agus Suwarno
Agus Suwarno 2015 年 10 月 17 日
回答済み: Walter Roberson 2015 年 10 月 18 日
Hi there, I currently working on a my study's final project One of which require me to solve this kind of equation
Objective is to maximize this function
r, sigma(i) --> for standard deviation, teta, and cov(i,j) are known number and I want to find the w(i) value with constraint: - Lower bound for w(i) is 0 - Upper bound for w(i) is 0 - Sum w(i) is 1
Any help is very appreciated and sorry for bad english

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 10 月 18 日
To maximize something, minimize its negative. You can use fmincon for that, using a lowerbound.
Although it might seem most natural to code sum(w)=1 as a linear equality constraint, that form is inefficient because it can take a lot of hunting to fit the equality. Instead use one fewer w, calculate the last w(i) as 1 minus sum(w(1:i-1)), and have a linear inequality constraint on sum(1:i-1) as being < 1 (strictly) so that there always some room for the last w(i)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by