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 
Return to the default flat view Create a new topic Submit Reply
Re: fit function [message #27312 is a reply to message #27291] Tue, 16 October 2001 14:20 Go to previous messageGo 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
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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 19:31:36 PDT 2025

Total time taken to generate the page: 0.00370 seconds