[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: non-linear fitting with bounds
From: |
Olaf Till |
Subject: |
Re: non-linear fitting with bounds |
Date: |
Sat, 13 Mar 2010 22:13:00 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sat, Mar 13, 2010 at 08:37:40PM +0100, Stefan Neumann wrote:
> Hi all,
>
> with leasqr() it is possible to fit data to an arbitrary non-linear
> function.
>
> Is there a way to introduce bounds, for example limit a parameter to be less
> that zero?
>
> Is there a way to introduce non-linear bounds?
In the last version (in package optim-1.0.12) bounds and linear
inequality constraints are implemented. Do not use an older version,
even if it should have a bounds implementation --- that implementation
was not good. But bounds are not implemented in such a way that you
can keep a parameter less than zero, you only can keep it less than or
equal to zero. You could keep it less than or equal to a small
negative number though. Bounds (but not general nonlinear constraints)
are also respected by the default function for the numerical
gradient. Nonlinear inequality constraints are probably a bit more
complicated. I intend to look into the latter in the future.
Olaf