From 2660bebea17e6bca0eaecf03c1b76e0b6feac4a4 Mon Sep 17 00:00:00 2001 From: Mykola Lukashchuk Date: Tue, 15 Oct 2024 11:44:53 +0200 Subject: [PATCH] test: add MvNormalMeanScalePrecision test --- test/projection/projected_to_normal_tests.jl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/projection/projected_to_normal_tests.jl b/test/projection/projected_to_normal_tests.jl index 0469301..76a6b85 100644 --- a/test/projection/projected_to_normal_tests.jl +++ b/test/projection/projected_to_normal_tests.jl @@ -95,7 +95,24 @@ end end +@testitem "Project a product of `MvNormalMeanScalePrecision` and `MvNormalMeanScalePrecision` to `MvNormalMeanScalePrecision`" begin + using BayesBase, ExponentialFamily, Distributions, LinearAlgebra + + include("./projected_to_setuptests.jl") + + @testset let distribution = ProductOf( + MvNormalMeanScalePrecision(ones(2), 2), + MvNormalMeanScalePrecision(ones(2), 3), + ) + @test test_projection_convergence( + distribution, + to = MvNormalMeanCovariance, + dims = (2, ), + conditioner = nothing, + ) + end +end @testitem "MLE" begin using BayesBase, ExponentialFamily, Distributions, JET @@ -123,6 +140,9 @@ end @test test_projection_mle(distribution) end + @testset let distribution = MvNormalMeanScalePrecision(ones(2), 2) + @test test_projection_mle(distribution) + end @testset let distribution = MvNormalMeanCovariance(ones(2), Matrix(Diagonal(ones(2)))) @test test_projection_mle(distribution)