Skip to content

Commit

Permalink
feat: add InverseGamma tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrais committed Aug 12, 2024
1 parent d2c93ae commit 3103a23
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/projection/projected_to_inverse_gamma_tests.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3103a23

Please sign in to comment.