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

Home » Public Forums » archive » Re: CURVEFIT for multiple datasets
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 for multiple datasets [message #58442] Fri, 01 February 2008 01:14 Go to previous message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Thu, 31 Jan 2008 04:55:11 -0800 (PST), chloesharrocks@gmail.com
wrote:

<snip>

> How can I extend this for the case when I have say 2data sets, ie:
> x=[[indgen(10)], [indgen(10)]]
> y=[[12.0, 11.0, 10.2, 9.4, 8.7, 8.1, 7.5, 6.9, 6.5, 6.1], [11.5, 10.8,
> 10.3, 9.5, 8.6, 7.8, 7.5, 6.4, 6.4, 5.9]
> and I want to plot an exponential curve through all of this data?

Euhm, I must be missing something here, but what's wrong with just
doing it. You are trying to fit 1 curve which fits best to all
datasets right? I.e. 3 parameters and not 3n parameters?



PRO CURVE_FITTING
x=[findgen(10),findgen(10)]
y=[12.0, 11.0, 10.2, 9.4, 8.7, 8.1, 7.5, 6.9, 6.5, 6.1, 11.5, 10.8,$
10.3, 9.5, 8.6, 7.8, 7.5, 6.4, 6.4, 5.9]

weights=1.0/y ;Define a vector of weights
A=[10.0, -0.1, 2.0] ;Provide an initial guess of the function's
parameters

yfit=CURVEFIT(x,y,weights, A, FUNCTION_NAME='gfunct') ;Compute the
parameters
print, 'Function parameters: ', A

plot, x, y, yrange=[5,13], ystyle=1, xrange=[0, 11], xstyle=1, psym=1

ind=sort(x)
oplot, x[ind], yfit[ind], linestyle=1, color=5
END;PRO CURVE_FITTING
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Is there a good procedure for Minimum Variance Analysis?
Next Topic: Re: Creating a dicom-file in HSV colors

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

Current Time: Thu Oct 09 21:02:19 PDT 2025

Total time taken to generate the page: 1.28256 seconds