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

Home » Public Forums » archive » Re: fitting multiple curves
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: fitting multiple curves [message #48686] Fri, 05 May 2006 12:04
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
nolan.smith1@gmail.com writes:

> Hello,
>
> I have several curves that I am trying to fit to one that can describe
> all the curves with a satisfactory chi-square. I have used before
> mpfit,mpfitpeak and mpfitfun but only to try to fit one curve. Can it
> be used to calculate a fit for several curves?If not are there any
> routines in IDL that I can use?

Sure, there's no limitation in MPFIT which holds you to one "curve."
You may have to switch to MPFITFUN. All it wants is a set of data
points and model points.

You just need to arrange your data in some pre-organized way (say by
concatenating the curves), and have your user-function know how to
produce a model with the same organization.

Example:
X = x values
Y1 = first curve & E1 = error in first curve
Y2 = second curve & E2 = error in second curve

XX = [X, X] & YY = [Y1, Y2] & EE = [E1, E2]
P = MPFITFUN('MYFUNCT', XX, YY, EE, P0)

If you have different parameters for each curve, then you will have to
tell your user-function how to partition XX, YY, and EE into the
component curves, and also how to break up the parameters. That's up
to you!

Happy fitting,
Craig

See also,
http://cow.physics.wisc.edu/~craigm/idl/fitqa.html#multivar


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: fitting multiple curves
Next Topic: Re: Animation formats revisited

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

Current Time: Fri Oct 10 11:22:11 PDT 2025

Total time taken to generate the page: 0.31963 seconds