[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Help-gsl] Additional parameters in Non-linear least-squares fitting
RE: [Help-gsl] Additional parameters in Non-linear least-squares fitting?
Sun, 30 Jul 2006 16:03:23 -0400
Thanks. I was able to get this to work on my sample problem, with the
the number of parameters to be fit nfit = 3.
the number of parameters for the function npars = 4 (the first 3 are the ones
to be fit)
set f.p = nfit;
gsl_vector length npars
gsl_matrix *covar = gsl_matrix_alloc (nfit, nfit);
s = gsl_multifit_fdfsolver_alloc (T, n, npars);
gsl_multifit_fdfsolver_set (s, &f, &x.vector);
the functions f.f and f.df use all four parameters, but the fourth is treated
as a constant.
No error messages about vector length and the result on a test is 'correct.'
Thanks for your help.
From: Martin Jansche [mailto:address@hidden
Sent: Sun 7/30/2006 1:58 PM
To: McFarlane Kenneth
Subject: Re: [Help-gsl] Additional parameters in Non-linear least-squares
On 7/30/06, address@hidden
> I need to pass additional parameters to the functions used by the N-L L-S
> routines. The functions I want to fit may have 6 parameters but I want to
> only 3 during the fit.
This means that, as far as the GSL API is concerned, you want to fit a
function with three parameters. Additional parameters can be passed
via the void *params argument of the component f of the structure
gsl_multifit_function. You may want to write one or more wrapper
routines that take a vector of parameters plus a boolean vector
indicating which parameters you want to vary as arguments and return
an appropriate gsl_multifit_function.
The information contained in this message is intended only for the recipient,
and may otherwise be privileged and confidential. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, please be aware that any
dissemination or copying of this communication is strictly prohibited. If you
have received this communication in error, please immediately notify us by
replying to the message and deleting it from your computer. This footnote also
confirms that this email has been scanned for all viruses by the Hampton
Universitys Center for Information Technology Enterprise Systems service.