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

Home » Public Forums » archive » Re: Minimization: Determine a constant across data sets
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: Minimization: Determine a constant across data sets [message #79813 is a reply to message #79806] Tue, 10 April 2012 07:58 Go to previous messageGo to previous message
Justin Cantrell is currently offline  Justin Cantrell
Messages: 5
Registered: May 2010
Junior Member
On Thursday, April 5, 2012 10:42:40 PM UTC-4, Justin wrote:
> Hi all!
>
> I have several data sets that follow the form:
>
> data = A* e^(-t/t0)+ y
>
> I suspect EVERY data set to have the same t0, but different A & y values. (ie: (A1,y1),(A2,y2)...)
> I can use MPFITFUN to fit A,t0 and y, but the routine determines a least chi-squared such that t0 is different for every data set.
>
> It would seem simple enough to fix t0 in MPFITFUN if I knew what the value was beforehand, but I don't :) Is there a way to minimize t0 across several data sets such that A & y are allowed to vary, but t0 is tied to every data set?
>
> I tried doing this in grids, but it was very computationally time consuming to search an unknown gridspace of t0 in an double for loop.
>
>
> Thanks!
> Justin



On Thursday, April 5, 2012 10:42:40 PM UTC-4, Justin wrote:
> Hi all!
>
> I have several data sets that follow the form:
>
> data = A* e^(-t/t0)+ y
>
> I suspect EVERY data set to have the same t0, but different A & y values. (ie: (A1,y1),(A2,y2)...)
> I can use MPFITFUN to fit A,t0 and y, but the routine determines a least chi-squared such that t0 is different for every data set.
>
> It would seem simple enough to fix t0 in MPFITFUN if I knew what the value was beforehand, but I don't :) Is there a way to minimize t0 across several data sets such that A & y are allowed to vary, but t0 is tied to every data set?
>
> I tried doing this in grids, but it was very computationally time consuming to search an unknown gridspace of t0 in an double for loop.
>
>
> Thanks!
> Justin

Awesome, I think I got it. Took a while to get the dimensions to agree.

result=mpfitfun('myfun',x,y(*,*),1.,guess,bestnorm=chisq)

FUNCTION myfun, X, P
;create the function from the inputs
s=size(p)
cols=(s(1)-1)/2
model=dblarr(cols,n_elements(x))
for i=0, cols-1 do begin
model(i,*)=[P[i]* EXP(-x/P[cols])+P[i+cols+1] ]
endfor
RETURN, model



END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rotated axis annotations in new graphics?
Next Topic: Re: Uneven background removal

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

Current Time: Sat Oct 11 15:31:51 PDT 2025

Total time taken to generate the page: 2.16008 seconds