[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] least-squares fitting or minimization with constrained pa
From: |
g1ul10 |
Subject: |
Re: [Help-gsl] least-squares fitting or minimization with constrained parameters |
Date: |
Fri, 9 Dec 2005 16:37:18 +0100 |
Hi Frank,
let me try to give you a general answer which has nothing to do with GSL
library. The better, safest and probably faster way of introducing the
kind of constraints you mention is through a re-parameterization of the
problem. For instance, if you want to fit the sum of two exponentials
a_1*exp{-b_1 t} + a_2 * exp{-b_2 t}
with b_2>b_1>0 and a_1,a_2>0 rewrite the function as
exp(-d_1^2 t+c_1) *(1.+exp(-d_2^2 t +c_2))
and fit c_1,c_2,d_1,d_2. When you have the fit, compute the old
variables as
a_1=exp(c_1)
a_2=a_1+exp(c_2)
b_1=d_1^2
b_2=d_1^2+d_2^2
and use the rules of propagation of errors to find the new error
bands.
Said that, some time ago I wrote a "wrapper" function around GSL
minimization functions which implements BOUNDARIES constraints through
change of variable approach. I use it for max-likelihood fitting and
it seems to work. If you still need it, just ask.
Hope this could help,
G.
On Fri, 09 Dec 2005 10:04:14 +0100
Frank Küster <address@hidden> wrote:
> Hi,
>
> I am wondering whether (and how) it is possible to use the least-squares
> fitting, or alternatively minimization functions of gsl with constrained
> parameters. What I mean with this is that I want to force the function
> into the correct local minimum by supplying information which parameter
> values are physically meaningful for these particular data, or which of
> two degenerate minima I would like (to be able to compare different
> fits). For example, if the function is the sum of two exponentials, I
> would like to perform a least-squares fit to some data with the
> constrain that the first of them has the shorter relaxation time.
>
> Is this possible, and how would that be implemented?
>
> TIA, Frank
> --
> Frank Küster
> Inst. f. Biochemie der Univ. Zürich
> Debian Developer
>
>
>
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
--
Giulio Bottazzi PGP Key ID:BAB0A33F
CAFiM Center for the Analysis of Financial Markets
LEM Laboratory of Economics and Management
Sant'Anna School for Advanced Studies, Pisa, Italy
Phone: (+39)-050-883365 Fax: (+39)-050-883344
email: address@hidden www.sssup.it/~bottazzi/