mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
tests: fit_corr_independent now runs for various methods.
This commit is contained in:
parent
919ba68a52
commit
6bbd88a8c1
1 changed files with 6 additions and 5 deletions
|
@ -171,12 +171,13 @@ def test_fit_corr_independent():
|
||||||
y = a[0] * anp.exp(-a[1] * x)
|
y = a[0] * anp.exp(-a[1] * x)
|
||||||
return y
|
return y
|
||||||
|
|
||||||
out = pe.least_squares(x, oy, func)
|
for method in ["Levenberg-Marquardt", "migrad", "Nelder-Mead"]:
|
||||||
out_corr = pe.least_squares(x, oy, func, correlated_fit=True)
|
out = pe.least_squares(x, oy, func, method=method)
|
||||||
|
out_corr = pe.least_squares(x, oy, func, correlated_fit=True, method=method)
|
||||||
|
|
||||||
assert np.isclose(out.chisquare, out_corr.chisquare)
|
assert np.isclose(out.chisquare, out_corr.chisquare)
|
||||||
assert (out[0] - out_corr[0]).is_zero(atol=1e-5)
|
assert (out[0] - out_corr[0]).is_zero(atol=1e-5)
|
||||||
assert (out[1] - out_corr[1]).is_zero(atol=1e-5)
|
assert (out[1] - out_corr[1]).is_zero(atol=1e-5)
|
||||||
|
|
||||||
|
|
||||||
def test_total_least_squares():
|
def test_total_least_squares():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue