[Gambas-user] curve fitting library ?

Wally wally at ...2037...
Mon Jan 23 13:29:58 CET 2012


The spline example is member of Gambas3 examples 
"Examples-> Drawing->GSLSpline"
or see attachment

I'll try to contact the author of fityk to get his opinion about what
we want to do. Fityk seems more clear and easier to implement.
On the other hand GSL covers a much wider range of functionality.



On Monday, January 23, 2012 03:42:32 Randall Morgan wrote:
> I don't think this app is licensed OSS. So I am not sure if you can legally
> write a module with it. The GSL or similar library is the way to go.
> 
> I have my plate full at the moment but I will try to give you as
> much guidance as I can. Be forewarned I too am still learning. Give me a
> day or two to go over the GSL and then we'll see what we can get done.
> 
> send me your demo of the spline as well.
> 
> On Mon, Jan 23, 2012 at 3:29 AM, Wally <wally at ...2037...> wrote:
> > Randall, Benoit
> > 
> > this example, using the spline stuff from the GSL is one of the most
> > simple functions in GSL. All the intersting rest is much more
> > confusing.
> > 
> > Have a look how easy fityk doing a peakfind on very noisy data:
> > (not sure the mailinglist allow me to attach screenshots )
> > honmepage: fityk.nieto.pl
> > 
> > On the other hand this fityk is not really free opensource i think.
> > 
> > But here is a code example of guessing gaussian peak from a
> > clean exp function:
> > 
> > #include <iostream>
> > #include <cmath>
> > 
> > #include <fityk.h>
> > 
> > using namespace std;
> > using namespace fityk;
> > 
> > int main()
> > {
> > 
> >    Fityk *f = new Fityk;
> >    cout << f->get_info("version", true) << endl;
> >    cout << "ln(2) = " << f->calculate_expr("ln(2)") << endl;
> >    const double mu = 12.345;
> >    for (int i = 0; i != 500; ++i) {
> >    
> >        double x = i / 100. + 10;
> >        double y = ceil(100 * exp(-(x-mu)*(x-mu)/2));
> >        f->add_point(x, y, sqrt(y));
> >    
> >    }
> >    f->execute("Y = randnormal(y, s)");
> >    f->execute("guess %gauss = Gaussian");
> >    f->execute("fit");
> >    cout << "peak center: " << f->calculate_expr("%gauss.Center") <<
> >    endl;
> >    delete f;
> >    return 0;
> > 
> > }
> > 
> > output:
> > 
> > Fityk 0.9.8
> > ln(2) = 0.693147
> > peak center: 12.3485
> > 
> > So ithink an implematation of GSL (or similar, maybe gnuplot))
> > would be great - but i'm not able to do it without help.
> > 
> > On Monday, January 23, 2012 03:06:29 Randall Morgan wrote:
> > > You must be familiar with C at some level? I'd be surprised if the
> > > GSL
> > > doesn't already have a C wrapper somewhere. I haven't used it in
> > > many
> > 
> > years
> > 
> > > so I can't recall, and I am sure it has changed. It sounds like
> > > you've
> > > already got a start. So you just need to invest more time into
> > > porting
> > 
> > GSL
> > 
> > > to Gambas.
> > > 
> > > On Mon, Jan 23, 2012 at 2:59 AM, Wally <wally at ...2037...> wrote:
> > > > On Monday, January 23, 2012 11:47:47 Benoît Minisini wrote:
> > > > > Le 22/01/2012 09:54, Wally a écrit :
> > > > > > Does anyone have experience with curve fitting and/or
> > > > > > peakfinding
> > > > > > using gambas ?    (e.g. example code)
> > > > > > 
> > > > > > Is there a plain C library (Linux) known, suitable to
> > > > > > this
> > > > > > problem
> > > > > > and gambas ?
> > > > > > 
> > > > > > Something like "fityk" (which is written in C++) but
> > > > > > written in
> > > > > > plain C to use with "EXTERN"
> > > > > > 
> > > > > > I might wrap the fityk C++ or try Gnu Scientific
> > > > > > Library, but
> > > > > > i'm still searching for alternatives.
> > > > > > 
> > > > > > wally
> > > > > 
> > > > > There is a GSLSpline example provided with Gambas. Does it
> > > > > help?
> > > > 
> > > > I did this example :)
> > 
> > ------------------------------------------------------------------------
> > 
> > > > ------ Try before you buy = See our experts in action!
> > > > The most comprehensive online learning library for Microsoft
> > > > developers is just $99.99! Visual Studio, SharePoint, SQL -
> > > > plus HTML5, CSS3,> 
> > MVC3,
> > 
> > > > Metro Style Apps, more. Free future releases when you subscribe
> > > > now!
> > > > http://p.sf.net/sfu/learndevnow-dev2
> > > > _______________________________________________
> > > > Gambas-user mailing list
> > > > Gambas-user at lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > 
> > ------------------------------------------------------------------------
> > ------ Try before you buy = See our experts in action!
> > The most comprehensive online learning library for Microsoft developers
> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> > Metro Style Apps, more. Free future releases when you subscribe now!
> > http://p.sf.net/sfu/learndevnow-dev2
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GSLSpline-3.0.tar.gz
Type: application/x-compressed-tar
Size: 9878 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120123/f8bf8a87/attachment.bin>


More information about the User mailing list