mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
fix: corrected bug that prevented combined fits with multiple x-obs in some cases (#241)
* fix: corrected bug that prevented combined fits with multiple x-obs in some cases * made test more complex * [Fix] Slightly increase tolerance for matrix function test. * Adapt test_merge_idx to compare lists --------- Co-authored-by: Simon Kuberski <simon.kuberski@cern.ch> Co-authored-by: Fabian Joswig <fjosw@users.noreply.github.com>
This commit is contained in:
parent
1d6f7f65c0
commit
4b1bb0872a
4 changed files with 21 additions and 7 deletions
|
@ -1082,6 +1082,20 @@ def test_combined_resplot_qqplot():
|
|||
fr = pe.least_squares(xd, yd, fd, resplot=True, qqplot=True)
|
||||
plt.close('all')
|
||||
|
||||
def test_combined_fit_xerr():
|
||||
fitd = {
|
||||
'a' : lambda p, x: p[0] * x[0] + p[1] * x[1],
|
||||
'b' : lambda p, x: p[0] * x[0] + p[2] * x[1],
|
||||
'c' : lambda p, x: p[0] * x[0] + p[3] * x[1],
|
||||
}
|
||||
yd = {
|
||||
'a': [pe.cov_Obs(3 + .1 * np.random.uniform(), .1**2, 'a' + str(i)) for i in range(5)],
|
||||
'b': [pe.cov_Obs(1 + .1 * np.random.uniform(), .1**2, 'b' + str(i)) for i in range(6)],
|
||||
'c': [pe.cov_Obs(3 + .1 * np.random.uniform(), .1**2, 'c' + str(i)) for i in range(3)],
|
||||
}
|
||||
xd = {k: np.transpose([[1 + .01 * np.random.uniform(), 2] for i in range(len(yd[k]))]) for k in fitd}
|
||||
pe.fits.least_squares(xd, yd, fitd)
|
||||
|
||||
|
||||
def test_x_multidim_fit():
|
||||
x1 = np.arange(1, 10)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue