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

Home » Public Forums » archive » help with curve fitting
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
help with curve fitting [message #85434] Sat, 03 August 2013 16:29 Go to previous message
paulartcoelho is currently offline  paulartcoelho
Messages: 30
Registered: March 2007
Member
hello,

i'm trying to use idl to fit (x,y) data using MPFIT by C. Markwardt. This is my first time doing curve fitting with IDL. I need to fit an exponential function of the form:

y = p[0]*(p[1]^(x/p[2]))+p[3]

which I empirically found to be a good fit to the data (by eye, plotting the data and overploting the function with some parameter guesses). By eye as well I sorted out good first guesses (don't know if i can attach a picture here). Nevertheless, I can't make it fit:

IDL> print,expr
P[0]*(p[1]^(x/p[2]))+p[3]
IDL> print,start
4.00000 -0.870000 180.000 1.00000
IDL> result=mpfitexpr(expr,l,f,1,start)
Iter 1 CHI-SQUARE = -NaN
P(0) = 4.00000
P(1) = -0.870000
P(2) = 180.000
P(3) = 1.00000
% MPFITEXPR: ERROR: parameter or function value(s) have become infinite; check model function for
over- and underflow
% Program caused arithmetic error: Floating illegal operand

Could someone point me out in the direction to solve this? Plotting the function with the same parameters and datasets do not generate any under- overflow error.

many thx
paula
[Message index]
 
Read Message
Read Message
Previous Topic: Best methods for finding a threshold edge, like a coastline?
Next Topic: Poly_Fit

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

Current Time: Fri Oct 10 10:53:37 PDT 2025

Total time taken to generate the page: 0.40403 seconds