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

Home » Public Forums » archive » Curvefit
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: curvefit [message #44403 is a reply to message #9041] Tue, 14 June 2005 09:16 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
nolan.smith1@gmail.com wrote:
> I spoke too soon!
> So I have set up my function:
> (the model I am trying to fit is y=a/((1+(x/b))^2) )
>
> FUNCTION myfun,X,P
> RETURN,P(0)/(1+(X/P(1))^2)
> END
>
> and then I try to run
>
> result=MPFITFUN('myfun',x,y,0.5,0.01)
The 4th argument should be an array with the errors on y and the
5th argument an array with the estimates for the parameters,
so try something like:

err=replicate(1,n_elements(x));constant errors in y
par=[0.5,0.01];parameter estimate

result=MPFITFUN('myfun',x,y,err,par)

>
> Where x,y are my x,y coordinates of the data that I am trying to fit,
> 0.5 is the first guess for P(0) and 0.01 is the first guess for P(1).
> As you guessed it is not working. What am I doing wrong?
>
> Thank you,
> Nolan
>
[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
Read Message
Previous Topic: Re: Locating IDL source code file
Next Topic: plotting data as it arrives using objects

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

Current Time: Sat Oct 11 14:12:37 PDT 2025

Total time taken to generate the page: 0.56240 seconds