diff --git a/test/runtests.jl b/test/runtests.jl index c6b8ed14..73419fbd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -207,7 +207,7 @@ if test_set == "plots" back_grad = Zygote.gradient(x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) - fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(3,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) + fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(4,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) @test isapprox(back_grad[1], fin_grad[1], rtol = 1e-6) end @@ -229,7 +229,7 @@ if test_set == "plots" back_grad = Zygote.gradient(x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) - fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(3,1, max_range = 1e-4),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) + fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(4,1, max_range = 1e-4),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) @test isapprox(back_grad[1], fin_grad[1], rtol = 1e-6) end @@ -249,7 +249,7 @@ if test_set == "plots" back_grad = Zygote.gradient(x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) - fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(3,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) + fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(4,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) @test isapprox(back_grad[1], fin_grad[1], rtol = 1e-6) end @@ -269,7 +269,7 @@ if test_set == "plots" back_grad = Zygote.gradient(x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) - fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(3,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) + fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(4,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) @test isapprox(back_grad[1], fin_grad[1], rtol = 1e-6) end @@ -290,7 +290,7 @@ if test_set == "plots" back_grad = Zygote.gradient(x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) - fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(3,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) + fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(4,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) @test isapprox(back_grad[1], fin_grad[1], rtol = 1e-6) end @@ -312,7 +312,7 @@ if test_set == "plots" back_grad = Zygote.gradient(x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) - fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(3,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) + fin_grad = FiniteDifferences.grad(FiniteDifferences.central_fdm(4,1),x-> get_loglikelihood(m, simulated_data(observables, :, :simulate), x), m.parameter_values) @test isapprox(back_grad[1], fin_grad[1], rtol = 1e-6) end