simultaneous fitting?

136 views
Skip to first unread message

Dan Parshall

unread,
May 17, 2012, 11:45:12 AM5/17/12
to fityk...@googlegroups.com
I'm using Fityk 1.0.1 for linux. 

I'm working with data which have scans taken under different conditions.  There should be the same number of peaks in each scan, and their centers and widths should be fixed across all scans, but their intensities should change.

There seems to be some bug, in that sometimes when trying to fit multiple datasets, fityk only fits one dataset, or one at a time, or something.  It's fairly reproducible, in that I can generate a script which reliably produces this effect.  I haven't been able to figure out what triggers this, though.

I'm pretty sure that I have my variables linked correctly, because fitting a single dataset will produce changes to the models in other scans (i.e., the centers and widths will be different).  But selecting all the scans/ datasets and trying to fit simultaneously results in only the last scan being fit.

Help?
--
Dan Parshall
Shorty George Productions
Boulder, CO

Christian Weikusat

unread,
May 17, 2012, 1:30:28 PM5/17/12
to fityk...@googlegroups.com
Sharing your script might help us to understand your problem!

Cheers,
Christian

Dan Parshall

unread,
May 17, 2012, 1:37:12 PM5/17/12
to fityk...@googlegroups.com
Attached, along with the datasets.  Thanks!

Escan__H_2.75__K_4.25__L_0.00__T_010K__.xye
Escan__H_2.25__K_4.75__L_0.00__T_010K__.xye
fit_script__HK_0p25_0p25.fit

Marcin Wojdyr

unread,
May 18, 2012, 7:43:00 PM5/18/12
to fityk...@googlegroups.com
There is no fit command in the script.
Do you use: "fit @*" ?

Marcin

Dan Parshall

unread,
May 18, 2012, 7:48:37 PM5/18/12
to fityk...@googlegroups.com
yes.  whether I use the GUI, or:
@* : fit
@0 @1 : fit

The result is the same :/

Marcin Wojdyr

unread,
May 18, 2012, 8:22:24 PM5/18/12
to fityk...@googlegroups.com
Try:
fit @*
The difference is that "fit @*" fits all datasets simultaneously,
while "@*: fit" fits all datasets one by one, separately.
The former takes more time but it's what you need.
Marcin
> --
> http://groups.google.com/group/fityk-users

Dan Parshall

unread,
May 21, 2012, 5:24:32 PM5/21/12
to fityk...@googlegroups.com
well, that worked.  Is this behavior different from earlier versions of fityk?  I recall being able to select multiple datasets and fit them simultaneously (actually, this was one of the key reasons I started working with fityk) ...

I strongly suggest you make this the default behavior in the future.  If the user wants to fit things one at a time, they can go through the datasets one-by-one.  But selecting multiple datasets should mean that they'll all be fit together.

Marcin Wojdyr

unread,
May 22, 2012, 12:37:42 PM5/22/12
to fityk...@googlegroups.com
Ok, I've just changed it. I've added a simple check if the fitted
models in different datasets use the same variables.
If they use, they are fitted together. Otherwise, one by one, which
should be faster.

Marcin

Dan Parshall

unread,
May 22, 2012, 5:37:27 PM5/22/12
to fityk...@googlegroups.com
Excellent, thank you.  I suspect that will be both more intuitive, and more flexible, for future users.

On a related note, is it possible to calculate the errors in this situation?  In my case, I'm fitting several peaks across multiple datasets.  When I try
@* : info peaks_err

the errors reported are, I believe, calculated for each individual dataset.  Because I'm fitting across many datasets, I feel like the error should be much lower than that reported.

Marcin Wojdyr

unread,
May 22, 2012, 6:53:23 PM5/22/12
to fityk...@googlegroups.com
You're right. That's one of two problems with "info peaks_err", the
other is output format.
OTOH if all datasets were included when calculating covariance matrix
and errors, it would be confusing for people who fit independent
datasets, because one dataset would affect errors in others
You may use Fit > Info and "info errors" to see uncertainties
calculated for all selected datasets together.
Marcin
> --
> http://groups.google.com/group/fityk-users

Dan Parshall

unread,
Sep 17, 2012, 2:03:25 PM9/17/12
to fityk...@googlegroups.com
Hi Marcin-

I'm following up on this earlier question.  If I use the command:
@*: info errors >> fileout_errordata

the result seems to be the error calculated for each separate scan. 

Is there a way to get the composite error from the command line?  That is, can I get the same result that comes by selecting all the datasets and using the menu option Fit > Info ?  And most of all, can I output it to a file?  While "info errors @1 >> fileout" works for an individual file, "info errors @* >> fileout" yields an error.

Thanks!

Marcin Wojdyr

unread,
Sep 27, 2012, 7:39:07 PM9/27/12
to fityk...@googlegroups.com
Dan,
sorry for late reply.

> While "info errors @1 >> fileout" works for an individual file, "info errors
> @* >> fileout" yields an error.

This problem should be fixed in ver. 1.2.0
https://github.com/wojdyr/fityk/commit/f12c677b8d9ac5e90ede9bcf11f6c9f7cfa23ede

Marcin
Reply all
Reply to author
Forward
0 new messages