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

Home » Public Forums » archive » Re: IDL - EXP fitting function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL - EXP fitting function [message #65898 is a reply to message #65897] Fri, 27 March 2009 06:27 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Vince Hradil wrote:
> On Mar 26, 5:55 pm, Christopher Thom <ct...@oddjob.uchicago.edu>
> wrote:
>> Quoth glen_a...@hotmail.com:
>>
>>
>>
>>> On Mar 26, 5:12 pm, David Fanning <n...@dfanning.com> wrote:
>>>> glen_a...@hotmail.com writes:
>>>> > Greetings everyone! My first post! I have some data x, y, that i would
>>>> > like to fit to a fitting function of the kind yfit = EXP(a+ b*x).
>>>> > where a and b are constants which i would like found. Any ideas on how
>>>> > to do this?
>>
>>>> ab = LinFit(x, y)
>>>> a = ab[0]
>>>> b = ab[1]
>>
>>>> Cheers,
>>
>>>> David
>>>> --
>>>> David Fanning, Ph.D.
>>>> Fanning Software Consulting, Inc.
>>>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>>>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>>
>>> Thanks for getting back to me David,
>>
>>> Does the linfit function work when i would like my data to be fitted to
>>> an EXP(a + bx) function? I didn't think that a linear function would be
>>> correct when considering the EXP? Or am i getting confused going from
>>> real space to log space!
>>
>> No, linfit() fits a linear model of the form y = A + B*x, so it will not
>> "just work". why don't you just fit a linear model in logspace?
>>
>> res = linfit(x, alog(yfit))
>> a = res[0]
>> b = res[1]
>>
>> cheers
>> chris
>
> I'll second that. This is really a linear problem, so no need to
> solve the non-linear equation.

I disagree. If you have negative measurements, or positive
but very small measurements, you will get bad results.
Also the result will not be the least-squares best fit.

Ciao,
Paolo
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL & ENVI error: WIDGET_CONTROL: Invalid widget identifier: 17
Next Topic: Re: IDL & ENVI error: WIDGET_CONTROL: Invalid widget identifier: 17

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

Current Time: Fri Oct 10 06:08:14 PDT 2025

Total time taken to generate the page: 0.31978 seconds