comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Fitting with three parameters ???
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Fitting with three parameters ??? [message #88760] Mon, 16 June 2014 03:49 Go to next message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello,

I have two columns of data, say variables X and Y. Now I want to fit the data with a function Y = x1 - x2 * exp(-x3 * X). I do not know what the values of x1, x2 and x3.

Can anyone say if there is automatic way in IDL to define our fitting function and then obtain the fitted parameters to the data? How is non-linear fitting done in IDL? Also, I would like to know which function will be able to give me R2 correlation coefficient?

Thanks in advance,
Madhavan
Re: Fitting with three parameters ??? [message #88761 is a reply to message #88760] Mon, 16 June 2014 03:55 Go to previous messageGo to next message
Moritz Fischer is currently offline  Moritz Fischer
Messages: 32
Registered: June 2013
Member
Hi,
You should take a look at Craig's MPFIT routines:
http://cow.physics.wisc.edu/~craigm/idl/fitting.html
cheers

Am 16.06.2014 12:49, schrieb Madhavan Bomidi:
> Hello,
>
> I have two columns of data, say variables X and Y. Now I want to fit
> the data with a function Y = x1 - x2 * exp(-x3 * X). I do not know
> what the values of x1, x2 and x3.
>
> Can anyone say if there is automatic way in IDL to define our fitting
> function and then obtain the fitted parameters to the data? How is
> non-linear fitting done in IDL? Also, I would like to know which
> function will be able to give me R2 correlation coefficient?
>
> Thanks in advance, Madhavan
>
Re: Fitting with three parameters ??? [message #88765 is a reply to message #88760] Mon, 16 June 2014 12:22 Go to previous message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
There are dozens of ways to do this, the MPFIT library is just one (albeit a very good one). IDL has several functions for minimization and there are dozens more available else where.

http://www.exelisvis.com/docs/routines-47.html


Russell


On Monday, June 16, 2014 6:49:18 AM UTC-4, Madhavan Bomidi wrote:

> Hello,
>
>
>
> I have two columns of data, say variables X and Y. Now I want to fit the data with a function Y = x1 - x2 * exp(-x3 * X). I do not know what the values of x1, x2 and x3.
>
>
>
> Can anyone say if there is automatic way in IDL to define our fitting function and then obtain the fitted parameters to the data? How is non-linear fitting done in IDL? Also, I would like to know which function will be able to give me R2 correlation coefficient?
>
>
>
> Thanks in advance,
>
> Madhavan
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: FL website
Next Topic: Please, please, please can we have a missing data color for image()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:37:49 PDT 2025

Total time taken to generate the page: 0.00539 seconds