mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
tests: tests for num_grad version of prior fits added.
This commit is contained in:
parent
89125c91e2
commit
f5c9a30266
1 changed files with 29 additions and 0 deletions
|
@ -97,6 +97,35 @@ def test_least_squares_num_grad():
|
|||
assert(num[1] == auto[1])
|
||||
|
||||
|
||||
def test_prior_fit_num_grad():
|
||||
x = []
|
||||
y = []
|
||||
for i in range(2, 5):
|
||||
x.append(i * 0.01)
|
||||
y.append(pe.pseudo_Obs(i * 0.01, 0.0001, "ens"))
|
||||
|
||||
num = pe.fits.least_squares(x, y, lambda a, x: np.exp(a[0] * x) + a[1], num_grad=True, priors=y[:2])
|
||||
auto = pe.fits.least_squares(x, y, lambda a, x: anp.exp(a[0] * x) + a[1], num_grad=False, piors=y[:2])
|
||||
|
||||
|
||||
def test_least_squares_num_grad():
|
||||
x = []
|
||||
y = []
|
||||
for i in range(2, 5):
|
||||
x.append(i * 0.01)
|
||||
y.append(pe.pseudo_Obs(i * 0.01, 0.0001, "ens"))
|
||||
|
||||
num = pe.fits.least_squares(x, y, lambda a, x: np.exp(a[0] * x) + a[1], num_grad=True)
|
||||
auto = pe.fits.least_squares(x, y, lambda a, x: anp.exp(a[0] * x) + a[1], num_grad=False)
|
||||
|
||||
assert(num[0] == auto[0])
|
||||
assert(num[1] == auto[1])
|
||||
|
||||
|
||||
assert(num[0] == auto[0])
|
||||
assert(num[1] == auto[1])
|
||||
|
||||
|
||||
def test_total_least_squares_num_grad():
|
||||
x = []
|
||||
y = []
|
||||
|
|
Loading…
Add table
Reference in a new issue