From 3103a238c7d5ab59a74b5bf02cef33b34aeb54de Mon Sep 17 00:00:00 2001 From: Mykola Lukashchuk Date: Mon, 12 Aug 2024 16:08:08 +0200 Subject: [PATCH] feat: add InverseGamma tests --- .../projected_to_inverse_gamma_tests.jl | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/projection/projected_to_inverse_gamma_tests.jl diff --git a/test/projection/projected_to_inverse_gamma_tests.jl b/test/projection/projected_to_inverse_gamma_tests.jl new file mode 100644 index 0000000..f1264d9 --- /dev/null +++ b/test/projection/projected_to_inverse_gamma_tests.jl @@ -0,0 +1,37 @@ +@testitem "Simple projection to `InverseGamma`" begin + using BayesBase, ExponentialFamily, Distributions, JET + using ExponentialFamilyProjection + + include("./projected_to_setuptests.jl") + + @testset let distribution = InverseGamma(1, 0.05) + @test test_projection_convergence(distribution) + end + + @testset let distribution = InverseGamma(1, 0.1) + @test test_projection_convergence(distribution) + end + + @testset let distribution = InverseGamma(1, 0.5) + @test test_projection_convergence(distribution, nsamples_range=100:200:2000) + end +end + +@testitem "MLE" begin + using BayesBase, ExponentialFamily, Distributions, JET + using ExponentialFamilyProjection + + include("./projected_to_setuptests.jl") + + @testset let distribution = InverseGamma(1, 0.1) + @test test_projection_mle(distribution) + end + + @testset let distribution = InverseGamma(1, 1) + @test test_projection_mle(distribution) + end + + @testset let distribution = InverseGamma(1, 10) + @test test_projection_mle(distribution) + end +end \ No newline at end of file