Skip to content

Commit

Permalink
add a few more tests around rank deficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Jul 11, 2024
1 parent 775a1c2 commit 66156b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/utils_and_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66156b2

Please sign in to comment.