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

2 vues (au cours des 30 derniers jours)
Pocho
Pocho le 21 Août 2012
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 commentaire
José-Luis
José-Luis le 22 Août 2012
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!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Econometrics Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by