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

Support for bootstrapping models with a mixture of correlation structures #577

Merged
merged 3 commits into from
Nov 3, 2021
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
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
MixedModels v4.4.1 Release Notes
========================
* Fix type parameterization in MixedModelsBootstrap to support models with a mixture of correlation structures (i.e. `zerocorr` in some but not all RE terms) [#577]

MixedModels v4.4.0 Release Notes
========================
* Add a constructor for the abstract type `MixedModel` that delegates to `LinearMixedModel` or `GeneralizedLinearMixedModel`. [#572]
Expand Down Expand Up @@ -306,3 +310,4 @@ Package dependencies
[#570]: https://github.com/JuliaStats/MixedModels.jl/issues/570
[#572]: https://github.com/JuliaStats/MixedModels.jl/issues/572
[#573]: https://github.com/JuliaStats/MixedModels.jl/issues/573
[#577]: https://github.com/JuliaStats/MixedModels.jl/issues/577
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MixedModels"
uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
author = ["Phillip Alday <[email protected]>", "Douglas Bates <[email protected]>", "Jose Bayoan Santiago Calderon <[email protected]>"]
version = "4.4.0"
version = "4.4.1"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ and correlations of the random-effects terms.
"""
struct MixedModelBootstrap{T<:AbstractFloat} <: MixedModelFitCollection{T}
fits::Vector
λ::Vector{<:Union{LowerTriangular{T,Matrix{T}},Diagonal{T,Vector{T}}}}
λ::Vector{Union{LowerTriangular{T},Diagonal{T}}}
inds::Vector{Vector{Int}}
lowerbd::Vector{T}
fcnames::NamedTuple
Expand Down
8 changes: 8 additions & 0 deletions test/bootstrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ end
@test typeof(pbzc) == MixedModelBootstrap{Float16}
end

@testset "zerocorr + not zerocorr" begin
form_zc_not = @formula(rt_trunc ~ 1 + spkr * prec * load +
(1 + spkr + prec + load | subj) +
zerocorr(1 + spkr + prec + load | item))
fmzcnot = fit(MixedModel, form_zc_not, dataset(:kb07))
pbzcnot = parametricbootstrap(MersenneTwister(42), 2, fmzcnot, Float16)
end

@testset "Bernoulli simulate! and GLMM boostrap" begin
contra = dataset(:contra)
# need a model with fast=false to test that we only
Expand Down