From 66156b2f48cbcd2ce4b0895cd910dbdefa4766b6 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Thu, 11 Jul 2024 14:46:44 +0200 Subject: [PATCH] add a few more tests around rank deficiency --- test/runtests.jl | 9 +++++---- test/utils_and_types.jl | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 6831c67..3eb1aea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -44,10 +44,11 @@ g1 = fit(MixedModel, rng = MersenneTwister(0) x = rand(rng, 100) -data = (x=x, x2=1.5 .* x, y=rand(rng, [0, 1], 100), z=repeat('A':'T', 5)) -mr = @suppress fit(MixedModel, @formula(y ~ x + x2 + (1 | z)), data; progress) -br = parametricbootstrap(MersenneTwister(42), 500, mr; progress, - optsum_overrides=(; ftol_rel=1e-6)) +a = rand(rng, 100) +data = (; x, x2=1.5 .* x, a, y=rand(rng, [0, 1], 100), g=repeat('A':'T', 5)) +mr = @suppress fit(MixedModel, @formula(y ~ a + x + x2 + (1 | g)), data; progress) +br = @suppress parametricbootstrap(MersenneTwister(42), 500, mr; progress, + optsum_overrides=(; ftol_rel=1e-6)) @testset ExtendedTestSet "MixedModelsMakie.jl" begin @testset "Aqua" begin diff --git a/test/utils_and_types.jl b/test/utils_and_types.jl index cccbd83..61c39fa 100644 --- a/test/utils_and_types.jl +++ b/test/utils_and_types.jl @@ -33,6 +33,12 @@ m1 = fit(MixedModel, @test wald.estimate ≈ boot.estimate rtol = 0.05 @test wald.lower ≈ boot.lower rtol = 0.05 @test wald.upper ≈ boot.upper rtol = 0.05 + + @test all(splat(isapprox), + zip(MixedModelsMakie.confint_table(mr).estimate, fixef(mr))) + + @test fixefnames(mr) == MixedModelsMakie.confint_table(mr).coefname + @test fixefnames(mr) == MixedModelsMakie.confint_table(br).coefname end @testset "ranefinfo" begin