Best way to minimize a function with a vector variable (1x25 vector) ?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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 Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!