help-gsl
[Top][All Lists]
Advanced

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

Re:[Help-gsl] fitting


From: Petr Ent
Subject: Re:[Help-gsl] fitting
Date: Wed, 01 Nov 2006 12:44:01 +0100 (CET)

> hi everyone,
> is it possible to do following thing with non-linear least squares fitting...?
> 
>        double x_init[3] = { 1.0, 0.0, 0.0 };
>        gsl_vector_view x = gsl_vector_view_array (x_init, p);
>        T = gsl_multifit_fdfsolver_lmsder;
>        s = gsl_multifit_fdfsolver_alloc (T, n, p);
> 
> for ( int i = 0; i < 100 000; i++ )
>        
>        gsl_multifit_fdfsolver_set (s, &f, &x.vector);
> 
>        do
>          {
>            iter++;
>            status = gsl_multifit_fdfsolver_iterate (s);
>      
>            if (status)
>              break;
>      
>            status = gsl_multifit_test_delta (s->dx, s->x,1e-4, 1e-4);
>          }
>        while (status == GSL_CONTINUE && iter < 500);
> end of for cycle
> 
> or another way .... is it possible to allocate solver, create vector from
> x_init, set this to solver and let it do its job in loop (with same x_init
> vector)? does it somehow change the original x_init vector?
> 
> thank you in advance
> best regards
> Petr Ent
> 

hello,
I was searching in some gsl related archives and I found some interesting 
information about my problem

http://sourceware.org/ml/gsl-discuss/2001/msg00284.html

I am observing the same problem, first round goes fine, but when I try to run 
my fitting routine more than once in one program run, it starts returning NANs 
in x vector to function, which is supposed to compute the value in current 
iteration

int (* f) (const gsl_vector * x, void * params, gsl_vector * f)

in those post from soureware, the solution is to add #include <gsl/gsl_blas.h> 
header, but unfortunately that does not work for me. has anyone solved this 
problem since then? or should I post whole source code here?

best regards 
Petr Ent




reply via email to

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