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

Home » Public Forums » archive » Re: fit function
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
Re: fit function [message #27291] Wed, 17 October 2001 01:31
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Craig Markwardt wrote:
>
> "Pavel A. Romashkin" <pavel.romashkin@noaa.gov> writes:
>
>> Reimar Bauer wrote:
>>>
>>> Dear all,
>>>
>>> I need a fit function which returns y=mx^n.
>>>
>>> Is someone able to share some code.
>>
>> Maybe, the following will do?
>>
>> FUNCTION junk, p, x=x, y=y
>> return, y - (p[0]*x^p[1])
>> END
>>
>> ; Here, X and Y are your vectors to be fitted.
>>
>> coefs = MPFIT('junk', [1.d, 1.d], functargs={x:x, y:y}, /quiet)
>>
>> This assumes that, just like everybody else, you have in your path
>> everything Craig cared to post on his web site :-)
>
> Sometimes I wonder if *I* have everything in my path that is posted on
> my web site. :-)
>
> By the way, in the example you posted Pavel, MPFIT is the only thing
> you need to run it. I try pretty hard to make most programs
> stand-alone.

Dear Pavel and Craig,

works now thanks.

It was to late yesterday and I have a cold.


regards
Reimar



--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======

read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
Re: fit function [message #27312 is a reply to message #27291] Tue, 16 October 2001 14:20 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Pavel A. Romashkin" <pavel.romashkin@noaa.gov> writes:

> Reimar Bauer wrote:
>>
>> Dear all,
>>
>> I need a fit function which returns y=mx^n.
>>
>> Is someone able to share some code.
>
> Maybe, the following will do?
>
> FUNCTION junk, p, x=x, y=y
> return, y - (p[0]*x^p[1])
> END
>
> ; Here, X and Y are your vectors to be fitted.
>
> coefs = MPFIT('junk', [1.d, 1.d], functargs={x:x, y:y}, /quiet)
>
> This assumes that, just like everybody else, you have in your path
> everything Craig cared to post on his web site :-)

Sometimes I wonder if *I* have everything in my path that is posted on
my web site. :-)

By the way, in the example you posted Pavel, MPFIT is the only thing
you need to run it. I try pretty hard to make most programs
stand-alone.

Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: fit function [message #27318 is a reply to message #27312] Tue, 16 October 2001 12:36 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Martin Downing" <martin.downing@ntlworld.com> writes:
> Looks like you want to implement one of Craig's fitting routines with a
> "m*x^n" function
>
> Martin
>
> "Reimar Bauer" <r.bauer@fz-juelich.de> wrote in message
> news:3BCC75F8.952BFBD1@fz-juelich.de...
>> Dear all,
>>
>>
>> I need a fit function which returns y=mx^n.
>>
>> Is someone able to share some code.

I feel that Reimer must be asking for more than the obvious. Either
that, or someone hijacked his email account. :-)

This function should do the trick:

function powlaw, x, p
return, p(0)*x^p(1)
end

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: fit function [message #27320 is a reply to message #27318] Tue, 16 October 2001 11:57 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Reimar Bauer wrote:
>
> Dear all,
>
> I need a fit function which returns y=mx^n.
>
> Is someone able to share some code.

Maybe, the following will do?

FUNCTION junk, p, x=x, y=y
return, y - (p[0]*x^p[1])
END

; Here, X and Y are your vectors to be fitted.

coefs = MPFIT('junk', [1.d, 1.d], functargs={x:x, y:y}, /quiet)

This assumes that, just like everybody else, you have in your path
everything Craig cared to post on his web site :-)
Cheers,
Pavel
Re: fit function [message #27321 is a reply to message #27320] Tue, 16 October 2001 11:19 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
Looks like you want to implement one of Craig's fitting routines with a
"m*x^n" function

Martin

"Reimar Bauer" <r.bauer@fz-juelich.de> wrote in message
news:3BCC75F8.952BFBD1@fz-juelich.de...
> Dear all,
>
>
> I need a fit function which returns y=mx^n.
>
> Is someone able to share some code.
>
> regards
> Reimar
>
> --
>
> Institut fuer Stratosphaerische Chemie (ICG-1)
> Forschungszentrum Juelich
> email: R.Bauer@fz-juelich.de
> http://www.fz-juelich.de/icg/icg1/
> ============================================================ ======
> a IDL library at ForschungsZentrum Juelich
> http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
>
> http://www.fz-juelich.de/zb/text/publikation/juel3786.html
> ============================================================ ======
>
> read something about linux / windows
> http://www.suse.de/de/news/hotnews/MS.html
Re: fit function [message #27322 is a reply to message #27321] Tue, 16 October 2001 11:07 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Reimar Bauer (r.bauer@fz-juelich.de) writes:

> I need a fit function which returns y=mx^n.
>
> Is someone able to share some code.

Under what kind of licensing arrangement? :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: the dimension of array
Next Topic: bug in contour?

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

Current Time: Wed Oct 08 11:29:20 PDT 2025

Total time taken to generate the page: 0.00594 seconds