Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fminsearch w/ parameter restrictions?

605 views
Skip to first unread message

Evan Palmer

unread,
Sep 22, 2005, 1:38:37 PM9/22/05
to
I am fitting a custom function (the ex-Wald, an exponential convolved
with a Wald (inverse Gaussian)) using a call to fminsearch. There
are four parameters that get passed to this function, and at least
one can be fixed and the others have sensible ranges I would like to
stay within (e.g., always positive).

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?

helper

unread,
Sep 22, 2005, 2:07:39 PM9/22/05
to
Evan Palmer wrote:
>
>
> I am fitting a custom function (the ex-Wald, an exponential
> convolved
> with a Wald (inverse Gaussian)) using a call to fminsearch. There
> are four parameters that get passed to this function, and at least
> one can be fixed and the others have sensible ranges I would like
> to
> stay within (e.g., always positive).
>
> 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

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>

Peter Perkins

unread,
Sep 22, 2005, 5:37:18 PM9/22/05
to
Evan Palmer wrote:

> 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.

John D'Errico

unread,
Sep 22, 2005, 6:17:34 PM9/22/05
to
In article <ef15e...@webx.raydaftYaTP>,
"Evan Palmer" <pal...@search.bwh.harvard.edu> wrote:


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

Evan Palmer

unread,
Sep 22, 2005, 6:33:36 PM9/22/05
to
helper, Peter, John--

These are all really good suggestions. I look forward to trying them
out tomorrow.

Many thanks!

-Evan

Marcus M. Edvall

unread,
Sep 22, 2005, 9:28:49 PM9/22/05
to
Hi 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>

Evan Palmer

unread,
Sep 23, 2005, 10:32:54 AM9/23/05
to

John--

fminsearchbnd works GREAT! It solved my problems beautifully.

Thanks!

-Evan

0 new messages