フィルターのクリア

Best way to minimize a function with a vector variable (1x25 vector) ?

1 回表示 (過去 30 日間)
Pocho
Pocho 2012 年 8 月 21 日
Hi,
I am trying to minimize a function that is a function of a 1x25 vector (weights_vector). In other words, I'm trying to find the values in the vector that minimize the function.
The function is defined by
function weights_correct = Moo(weights_vector)
corr_matrix = evalin('base', 'corr_matrix');
tolerance = evalin('base', 'tolerance');
returns = evalin('base', 'returns');
weights_correct = weights_vector'*corr_matrix*weights_vector - tolerance*returns'*weights_vector;
end
On this function, I am calling
weights_correct = fminsearch(@Moo, weights_vector);
This iterates until I see the error
"Exiting: Maximum number of function evaluations has been exceeded
- increase MaxFunEvals option."
Which leads me to believe that I'm not minimizing correctly. What's going on?
  1 件のコメント
José-Luis
José-Luis 2012 年 8 月 22 日
Optimizing a function with 25 variables is a tall order. Most optimization algorithms will choke with that. If you are using the Nelder Meade algorithm of fminsearch I daresay you are wasting your time. If you have any ideas about the ranges of those variables, I would point you towards: href = ""<http://www.mathworks.com/matlabcentral/fileexchange/8277-fminsearchbnd</a>>
But unless you have very narrow bounds I would recommend against it. You might want to look into some statistical methods, such as Markov Chain Monte Carlo:
href = ""<http://psiexp.ss.uci.edu/research/teachingP205C/205C.pdf</a>>
Cheers!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by