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

add a few more tests around rank deficiency #98

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
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
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
Loading