Bug 471174 - [Feature request]: make fitting with uncertainties a little more intuitive
Summary: [Feature request]: make fitting with uncertainties a little more intuitive
Status: RESOLVED MOVED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (show other bugs)
Version: 2.10.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Gerlach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-18 00:47 UTC by João Figueiredo
Modified: 2023-06-23 22:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description João Figueiredo 2023-06-18 00:47:39 UTC
SUMMARY
When doing a fit, checking "Use given data uncertainties" on fit options has no effect.

STEPS TO REPRODUCE
1. Create a fit, making sure the spreadsheet has a column for the Y uncertainties.
2. Now disable the "Use given data uncertainties" option, re-run the fit, and compare the results

OBSERVED RESULT
Nothing changes.

EXPECTED RESULT
For instance, one would expect the uncertainties to influence the χ² calculation, since we should be dividing each squared residual by the variance of each point, which changes according to its uncertainty.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.3.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Stefan Gerlach 2023-06-23 15:26:05 UTC
Did you select the weights for the data uncertainties to use?
When i select "Instrumental (1/col²)" and the third column (Y uncertainties) for Y-Weight, the fit changes accordingly.
Comment 2 João Figueiredo 2023-06-23 17:57:03 UTC
(In reply to Stefan Gerlach from comment #1)
> Did you select the weights for the data uncertainties to use?
> When i select "Instrumental (1/col²)" and the third column (Y uncertainties)
> for Y-Weight, the fit changes accordingly.

Ohh, I see... So that's what I was missing.
To be fair, I don't think it's very intuitive right now: I add a column with the uncertainties, and then the only obvious uncertainty-related option I see on the fitting window is that "Use given data uncertainties" checkbox; I see that it's checked, so I figure that means it must be using the uncertainties I previously added (so what does it do, then?).

I never would've guessed I had to manually add them as a weight (and I've been a proud LabPlot user for years!). Sure, retrospectively, I get the logic: the uncertainties will be treated as a generic data weight by the fitting algorithm (more uncertainty = less weight).

But could we perhaps rework things a little so the workflow is slightly more intuitive? For example, on the dialog that pops up when we attempt to create a fit from a spreadsheet, we could add a data input for the uncertainty (just like with X-Data and Y-Data). Then, if a column is selected, we could ask for a weight (or maybe just set it to "instrumental" by default, that's probably what most users expect when working with uncertainties).
Comment 3 Stefan Gerlach 2023-06-23 22:12:40 UTC
Added issue https://invent.kde.org/education/labplot/-/issues/577 to fix this.