Commit 2b0d3791 authored by Rouven Lemmerz's avatar Rouven Lemmerz Committed by Philipp Arras
Browse files

Added tests

parent 7e28bd27
......@@ -32,7 +32,7 @@ space = list2fixture([ift.GLSpace(15),
seed = list2fixture([4, 78, 23])
def testInverseGammaAccuracy(space, seed):
def testInterpolationAccuracy(space, seed):
S = ift.ScalingOperator(space, 1.)
pos = S.draw_sample()
alpha = 1.5
......@@ -45,3 +45,7 @@ def testInverseGammaAccuracy(space, seed):
arr1 = op(pos).val
arr0 = invgamma.ppf(norm.cdf(pos.val), alpha, scale=q)
assert_allclose(arr0, arr1)
op = ift.UniformOperator(space, scale=qfld)
arr1 = op(pos).val
arr0 = norm.cdf(pos.val)*q
assert_allclose(arr0, arr1, rtol=1e-5)
......@@ -96,8 +96,9 @@ def testPointModel(space, seed):
alpha = 1.5
q = 0.73
model = ift.InverseGammaOperator(space, alpha, q)
# FIXME All those cdfs and ppfs are not very accurate
ift.extra.check_jacobian_consistency(model, pos, tol=1e-2, ntries=20)
ift.extra.check_jacobian_consistency(model, pos, tol=1e-5, ntries=20)
model = ift.UniformOperator(space)
ift.extra.check_jacobian_consistency(model, pos, tol=1e-6, ntries=20)
@pmp('neg', [True, False])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment