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 #65905 is a reply to message #65901] Thu, 26 March 2009 19:11 Go to previous messageGo to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
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.
[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 11:31:58 PDT 2025

Total time taken to generate the page: 1.36063 seconds