From c3acdf2f4bef1cc9dc733a9b2bcbe6edefa0c08a Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Wed, 15 May 2024 12:51:40 -0500 Subject: [PATCH 1/2] delegate as many GLMM properties as possible to internal LMM --- src/generalizedlinearmixedmodel.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generalizedlinearmixedmodel.jl b/src/generalizedlinearmixedmodel.jl index e33429b81..f9f6ad5dc 100644 --- a/src/generalizedlinearmixedmodel.jl +++ b/src/generalizedlinearmixedmodel.jl @@ -489,12 +489,12 @@ function Base.getproperty(m::GeneralizedLinearMixedModel, s::Symbol) σs(m) elseif s == :σρs σρs(m) - elseif s ∈ (:A, :L, :optsum, :reterms, :Xymat, :feterm, :formula, :parmap) - getfield(m.LMM, s) - elseif s ∈ (:dims, :λ, :lowerbd, :corr, :PCA, :rePCA, :X) - getproperty(m.LMM, s) elseif s == :y m.resp.y + elseif !hasfield(GeneralizedLinearMixedModel, s) && s ∈ propertynames(m.LMM, true) + # automatically delegate as much as possible to the internal local linear approximation + # NB: the !hasfield call has to be first since we're calling getproperty() with m.LMM... + getproperty(m.LMM, s) else getfield(m, s) end From 484d33bb386034282215acc13638f4b014476faf Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Wed, 15 May 2024 15:45:49 -0500 Subject: [PATCH 2/2] NEWS and version bump --- NEWS.md | 5 +++++ Project.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index cc2f91e03..acf1b91cc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +MixedModels v4.24.0 Release Notes +============================== +* Properties for `GeneralizedLinearMixedModel` now default to delegation to the internal weighted `LinearMixedModel` when that property is not explicitly handled by `GeneralizedLinearMixedModel`. Previously, properties were delegated on an explicit basis, which meant that they had to be added manually as use cases were discovered. The downside to the new approach is that it is now possible to access properties whose definition in the LMM case doesn't match the GLMM definition when the GLMM definition hasn't been explicitly been implemented. [#767] + MixedModels v4.23.1 Release Notes ============================== * Fix for `simulate!` when only the estimable coefficients for a rank-deficient model are provided. [#756] @@ -516,3 +520,4 @@ Package dependencies [#748]: https://github.com/JuliaStats/MixedModels.jl/issues/748 [#755]: https://github.com/JuliaStats/MixedModels.jl/issues/755 [#756]: https://github.com/JuliaStats/MixedModels.jl/issues/756 +[#767]: https://github.com/JuliaStats/MixedModels.jl/issues/767 diff --git a/Project.toml b/Project.toml index 7020d82ac..225f9aa54 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MixedModels" uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316" author = ["Phillip Alday ", "Douglas Bates ", "Jose Bayoan Santiago Calderon "] -version = "4.23.1" +version = "4.24.0" [deps] Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"