From 0dc81c53c0ffba3c2deabe0bb700785e5f776241 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Thu, 4 Sep 2025 22:22:07 +0200 Subject: [PATCH 1/5] display fix for unlikely but possible type inference failure in bootstrap table --- NEWS.md | 5 +++++ Project.toml | 2 +- src/bootstrap.jl | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8ce4cb1bd..1b11fba09 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +MixedModels v5.0.3 Release Notes +============================== +- Small update in some code related to displaying dispersion parameters in cases where inference has failed. [#865] + MixedModels v5.0.2 Release Notes ============================== - The default display and `confint` methods for bootstrap results from models without dispersion parameters has been fixed. [#861] @@ -695,3 +699,4 @@ Package dependencies [#858]: https://github.com/JuliaStats/MixedModels.jl/issues/858 [#860]: https://github.com/JuliaStats/MixedModels.jl/issues/860 [#861]: https://github.com/JuliaStats/MixedModels.jl/issues/861 +[#865]: https://github.com/JuliaStats/MixedModels.jl/issues/865 diff --git a/Project.toml b/Project.toml index 0ed61fc22..ed744c8e8 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MixedModels" uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316" author = ["Phillip Alday ", "Douglas Bates "] -version = "5.0.2" +version = "5.0.3" [deps] Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" diff --git a/src/bootstrap.jl b/src/bootstrap.jl index 9883dcbb1..71e9f29c7 100644 --- a/src/bootstrap.jl +++ b/src/bootstrap.jl @@ -359,7 +359,10 @@ function StatsBase.confint( par = filter(collect(propertynames(tbl))) do k k = string(k) # σ is missing in models without a dispersion parameter - if k == "σ" && Missing <: eltype(tbl.σ) + Tσ = eltype(tbl.σ) + # see https://github.com/JuliaStats/MixedModels.jl/pull/861#discussion_r2323094090 + # for more info on why this logic is so convulated + if k == "σ" && ((Tσ === Any && any(ismissing, tbl.σ)) || Missing <: Tσ) return false end return !startswith(k, 'θ') && k != "obj" From 2b03e36aceaab208554ae7b509de911d929c235e Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Thu, 4 Sep 2025 22:25:42 +0200 Subject: [PATCH 2/5] format --- src/bootstrap.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap.jl b/src/bootstrap.jl index 71e9f29c7..3d8d7674c 100644 --- a/src/bootstrap.jl +++ b/src/bootstrap.jl @@ -362,7 +362,7 @@ function StatsBase.confint( Tσ = eltype(tbl.σ) # see https://github.com/JuliaStats/MixedModels.jl/pull/861#discussion_r2323094090 # for more info on why this logic is so convulated - if k == "σ" && ((Tσ === Any && any(ismissing, tbl.σ)) || Missing <: Tσ) + if k == "σ" && ((Tσ === Any && any(ismissing, tbl.σ)) || Missing <: Tσ) return false end return !startswith(k, 'θ') && k != "obj" From 608c06c618126d20cda4f8f1bd94ba701635f6ee Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Sat, 6 Sep 2025 06:25:24 +0000 Subject: [PATCH 3/5] Update src/bootstrap.jl Co-authored-by: Alex Arslan --- src/bootstrap.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap.jl b/src/bootstrap.jl index 3d8d7674c..9cf6dac5f 100644 --- a/src/bootstrap.jl +++ b/src/bootstrap.jl @@ -360,8 +360,8 @@ function StatsBase.confint( k = string(k) # σ is missing in models without a dispersion parameter Tσ = eltype(tbl.σ) - # see https://github.com/JuliaStats/MixedModels.jl/pull/861#discussion_r2323094090 - # for more info on why this logic is so convulated + # If inference failed when constructing `tbl.σ`, we can't rely on the element + # type to know whether missing values may be present if k == "σ" && ((Tσ === Any && any(ismissing, tbl.σ)) || Missing <: Tσ) return false end From 5b02e5b59880184628f42c3c077a845b0966d569 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Tue, 9 Sep 2025 20:44:15 +0200 Subject: [PATCH 4/5] Update src/bootstrap.jl Co-authored-by: Alex Arslan --- src/bootstrap.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap.jl b/src/bootstrap.jl index 9cf6dac5f..b1692a4c2 100644 --- a/src/bootstrap.jl +++ b/src/bootstrap.jl @@ -362,7 +362,7 @@ function StatsBase.confint( Tσ = eltype(tbl.σ) # If inference failed when constructing `tbl.σ`, we can't rely on the element # type to know whether missing values may be present - if k == "σ" && ((Tσ === Any && any(ismissing, tbl.σ)) || Missing <: Tσ) + if k == "σ" && ((Tσ === Any && any(ismissing, tbl.σ)) || (Tσ !== Any && Missing <: Tσ)) return false end return !startswith(k, 'θ') && k != "obj" From e61011ea8e634d36b14178a9bc4983ac1db7c695 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Tue, 9 Sep 2025 20:48:27 +0000 Subject: [PATCH 5/5] Update src/bootstrap.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/bootstrap.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap.jl b/src/bootstrap.jl index b1692a4c2..34c717ed1 100644 --- a/src/bootstrap.jl +++ b/src/bootstrap.jl @@ -362,7 +362,8 @@ function StatsBase.confint( Tσ = eltype(tbl.σ) # If inference failed when constructing `tbl.σ`, we can't rely on the element # type to know whether missing values may be present - if k == "σ" && ((Tσ === Any && any(ismissing, tbl.σ)) || (Tσ !== Any && Missing <: Tσ)) + if k == "σ" && + ((Tσ === Any && any(ismissing, tbl.σ)) || (Tσ !== Any && Missing <: Tσ)) return false end return !startswith(k, 'θ') && k != "obj"