Closed hartytp closed 1 year ago
yep, I rekon the issue is that we should be setting self.sigma
here https://github.com/OxIonics/ionics_fits/blob/4d62cc59f02cc23dfc35732b8efd94b0799bfc7d/ionics_fits/common.py#L439 rather than later on after the value has been scaled.
Doing that gives me something more sensible
y_fit = [21160.09391833, 19039.49397351, 16918.89402869, 14798.29408387, 12677.69413905, 10557.09419423, 8436.49424941, 6315.89430459, 7070.83706396, 9191.43700878]
y = [21066.66666667, 20066.66666667, 18800., 14733.33333333, 11333.33333333, 9000., 8333.33333333, 7533.33333333, 7400. 8800.]
sigma = [1185.09258898, 1156.62343819, 1119.52370825, 991.07124982, 869.22698736, 774.59666924, 745.3559925, 708.67638752, 702.37691686, 765.94168621]
chi_2 = 13.50659585681905
p = 0.06068599499611331
That's more reasonable but the significance still feels a bit low. @saking2 would you mind casting an eye over the expression above and seeing if you can spot anything obviously wrong?
For a reasonable dataset (see below) the chi2 is coming out as 0. Probably just doing something daft here as this code hasn't been used in anger.
Relevant code is https://github.com/OxIonics/ionics_fits/blob/4d62cc59f02cc23dfc35732b8efd94b0799bfc7d/ionics_fits/normal.py#L88
data is:
Casting an eye over that data, the value of
self.sigma
looks way too low here. Probably an error in the scaling code.cc @saking2