Skip to content

Unable to add relative errors with reference model #244

Closed Answered by cverstege
cverstege asked this question in Q&A
Discussion options

You must be logged in to vote

This behaviour is expected 💡:
The data itself doesn't know the model yet. All uncertainties added to the data container will be uncertainties on the data only.
If you want to set an uncertainty with a reference to the model, use the add_error function of the Fit object instead. The fit has knowledge about both, the data 📊 and the model 📈.

>>> from kafe2 import XYContainer, Fit
>>> data = XYContainer([1,2,3], [1,7,19])
>>> fit = Fit(data)  # this defaults to a line fit, with the model y=a*x+b
>>> fit.add_error(axis="y", err_val=0.1, relative=True, reference="model")

If you want to add a relative error to the data, use reference="data" instead.

Replies: 1 comment

Comment options

cverstege
Dec 6, 2023
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by cverstege
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant