How can I have fminsearch restrict its search of the parameter space
to be within bounds that I specify? Is this possible?
Thanks in advance for any help you can offer.
-Evan
PS-- I would also like to restrict one of the parameters to be a
positive integer--is that possible?
FMINSEARCH doesn't handle constraints or bounds. For this, you need
FMINCON in the optimziation toolbox.
>
> PS-- I would also like to restrict one of the parameters to be a
> positive integer--is that possible?
Check out this link:
<http://www.mathworks.com/support/solutions/data/1-10PDHC.html?solution=1-10PDHC>
> How can I have fminsearch restrict its search of the parameter space
> to be within bounds that I specify? Is this possible?
One of two ways:
1) If these are box constraints, transform the parameters using a log or logit,
to get unconstrained parameters. For example, if your constraint is x1 < 10,
transform to y1 = log(10-x1).
2) have your objective return a large finite value when outside the constraint
boundaries.
Either of these will work when the solution is not at or very near a constraint
boundary. Not so well if otherwise.
Hope this helps.
- Peter Perkins
The MathWorks, Inc.
fminsearchbnd will constrain parameters to be
within bound constraints. See here:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=
8277&objectType=file
Integer constraints will require an IP code of some
sort. There are some on the file exchange.
Simplest if there are only a few possible levels of
the integer variable is to solve multiple subproblems
fixing the integer variable at a different value for
each. Then take the best of the alternatives posed.
HTH,
John D'Errico
--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945
Those who can't laugh at themselves leave the job to others.
Anonymous
These are all really good suggestions. I look forward to trying them
out tomorrow.
Many thanks!
-Evan
Take a look at mnilpBB in TOMLAB /MINLP - you can then solve general
nonlinear problems with integer variables.
Best wishes, Marcus
Tomlab Optimization Inc.
<http://tomlab.biz>
John--
fminsearchbnd works GREAT! It solved my problems beautifully.
Thanks!
-Evan