Re: fit function [message #27291] |
Wed, 17 October 2001 01:31 |
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  |
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  |
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  |
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
|
|
|
|
|