From b1012d37fdc33c73e614c21f9a5d4955078df257 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Mon, 10 May 2021 22:07:17 +0200 Subject: [PATCH 1/2] omit lowerbod on beta for GLMM bootstrap --- src/bootstrap.jl | 2 +- test/bootstrap.jl | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bootstrap.jl b/src/bootstrap.jl index 619aae883..7051599c9 100644 --- a/src/bootstrap.jl +++ b/src/bootstrap.jl @@ -119,7 +119,7 @@ function parametricbootstrap( samp, deepcopy(morig.λ), getfield.(morig.reterms, :inds), - copy(morig.optsum.lowerbd), + morig.optsum.lowerbd[1:length(first(samp).θ)], NamedTuple{Symbol.(fnames(morig))}(map(t -> (t.cnames...,), morig.reterms)), ) end diff --git a/test/bootstrap.jl b/test/bootstrap.jl index 2bad26896..3b3d629ff 100644 --- a/test/bootstrap.jl +++ b/test/bootstrap.jl @@ -100,8 +100,12 @@ end @testset "Bernoulli simulate! and GLMM boostrap" begin contra = dataset(:contra) - gm0 = fit(MixedModel, only(gfms[:contra]), contra, Bernoulli(), fast=true) + # need a model with fast=false to test that we only + # copy the optimizer constraints for θ and not β + gm0 = fit(MixedModel, only(gfms[:contra]), contra, Bernoulli(), fast=false) bs = parametricbootstrap(StableRNG(42), 100, gm0) + # make sure we're not copying + @test length(bs.lowerbd) == length(gm0.θ) bsci = filter!(:type => ==("β"), DataFrame(shortestcovint(bs))) ciwidth = 2 .* stderror(gm0) waldci = DataFrame(coef=fixefnames(gm0), From db887d6635bca7c5fb86c505536e8e339a3676c8 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Mon, 10 May 2021 22:13:45 +0200 Subject: [PATCH 2/2] news update --- NEWS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.md b/NEWS.md index 011b1da77..731c07439 100644 --- a/NEWS.md +++ b/NEWS.md @@ -36,6 +36,11 @@ Run-time formula syntax * Methods for `Base./(::AbstractTerm, ::AbstractTerm)` are added, allowing nesting syntax to be used with `Term`s at run-time as well [#470] +MixedModels v3.7.0 Release Notes +======================== +* Add `condVar` and `condVartables` for computing the conditional variance on the random effects [#492] +* Bugfix: store the correct lower bound for GLMM bootstrap, when the original model was fit with `fast=false` [#518] + MixedModels v3.6.0 Release Notes ======================== * Add `likelihoodratiotest` method for comparing non-mixed (generalized) linear models to (generalized) linear mixed models [#508]. @@ -227,9 +232,11 @@ Package dependencies [#486]: https://github.com/JuliaStats/MixedModels.jl/issues/486 [#489]: https://github.com/JuliaStats/MixedModels.jl/issues/489 [#490]: https://github.com/JuliaStats/MixedModels.jl/issues/490 +[#492]: https://github.com/JuliaStats/MixedModels.jl/issues/492 [#493]: https://github.com/JuliaStats/MixedModels.jl/issues/493 [#495]: https://github.com/JuliaStats/MixedModels.jl/issues/495 [#501]: https://github.com/JuliaStats/MixedModels.jl/issues/501 [#506]: https://github.com/JuliaStats/MixedModels.jl/issues/506 [#507]: https://github.com/JuliaStats/MixedModels.jl/issues/507 [#508]: https://github.com/JuliaStats/MixedModels.jl/issues/508 +[#518]: https://github.com/JuliaStats/MixedModels.jl/issues/518