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 #65914 is a reply to message #65905] Thu, 26 March 2009 15:55 Go to previous messageGo to previous message
Christopher Thom is currently offline  Christopher Thom
Messages: 66
Registered: October 2006
Member
Quoth glen_andy@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
[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: Sat Oct 11 08:50:41 PDT 2025

Total time taken to generate the page: 0.64290 seconds