help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] non-linear least squares fitting


From: Barrett C. Foat
Subject: Re: [Help-gsl] non-linear least squares fitting
Date: Tue, 4 Dec 2007 12:52:26 -0600
User-agent: KMail/1.9.3

Hi Jay,

Your answers are inline below.

On Tuesday 04 December 2007 12:17, Jay Howard wrote:
> I have a couple of questions about GSL's non-linear least squares
> functions.   Apologies in advance if they're particularly dumb
> questions; I freely admit that I'm working at the edge of my expertise
> here.
>
> First:
>
> The online docs describe two methods, gsl_multifit_fsolver_alloc() and
> gsl_multifit_fdfsolver_alloc(), that are used to allocate new solvers.
>  They accept a gsl_multifit_fsolver_type and
> gsl_multifit_fdfsolver_type respectively.  When I examine the header
> file gsl_multifit_nlin.h, I notice that it declares two solver types
> of the second form (gsl_multifit_fdfsolver_lmder and
> gsl_multifit_fdfsolver_lmsder) but none of the first form.  One
> appears to have been available once upon a time
> (gsl_multifit_fsolver_gradient) but but in my header file it's
> commented out
>
> As the caller, am I expected to define my own gs_multifit_fsolver_type
> to pass to gsl_multifit_fsolver_alloc()?

Typical usage would be to use gsl_multifit_fdfsolver_lmsder or 
gsl_multifit_fdfsolver_lmsder as the gsl_multifit_fsolver_type. Look at 
the variable "T" in the example here:
http://www.gnu.org/software/gsl/manual/html_node/Example-programs-for-Nonlinear-Least_002dSquares-Fitting.html

>
> Second:
>
> The fdfsolver docs state that the number of observations (n) must
> equal or exceed the number of parameters (p).  For my project, I only
> have one function/observation, F(X1, ..., Xp), that I'm attempting to
> minimize.  For the purposes of using the LM functions, would it
> suffice to just duplicate this function/observation p times, so that
> the (n >= p) requirement is satisfied?  This would be the special case
> where F1 = F2 = ... = Fn with (n = p).

I believe you are misinterpretting the docs. The total number of 
observations (n) (= total number of equations) should be greater than or 
equal to the number of parameters (p) that you have in each equation. You 
should only have one equation (called "function" in the docs) per 
observation.

Hopefully this helps.

Barrett Foat
>
> Thanks in advance.
>
>
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]