Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add MvNormalMeanScalePrecision test #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/projection/projected_to_normal_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading