From 41609b52c138e4489d7eab817e3a98dde4695b5b Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Mon, 25 Mar 2024 13:57:44 -0500 Subject: [PATCH] readability Co-authored-by: Alex Arslan --- src/generalizedlinearmixedmodel.jl | 4 ++-- test/bootstrap.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generalizedlinearmixedmodel.jl b/src/generalizedlinearmixedmodel.jl index 1b04ce9e0..c3c8b13be 100644 --- a/src/generalizedlinearmixedmodel.jl +++ b/src/generalizedlinearmixedmodel.jl @@ -426,7 +426,7 @@ function GeneralizedLinearMixedModel( LMM.optsum, ) end - X = view(LMM.X, :, 1:(LMM.feterm.rank)) + X = fullrankx(LMM.feterm) # if the response is constant, there's no point (and this may even fail) # we allow this instead of simply failing so that a constant response can # be used as the starting point to simulation where the response will be @@ -794,7 +794,7 @@ function updateη!(m::GeneralizedLinearMixedModel{T}) where {T} b = m.b u = m.u reterms = m.LMM.reterms - mul!(η, view(modelmatrix(m), :, 1:(m.LMM.feterm.rank)), m.β) + mul!(η, view(modelmatrix(m), :, 1:rank(m)), m.β) for i in eachindex(b) mul!(η, reterms[i], vec(mul!(b[i], reterms[i].λ, u[i])), one(T), one(T)) end diff --git a/test/bootstrap.jl b/test/bootstrap.jl index b49860c18..576aad918 100644 --- a/test/bootstrap.jl +++ b/test/bootstrap.jl @@ -235,7 +235,7 @@ end @test all(boot.β) do nt # if we're the dropped coef, then we must be -0.0 # need isequal because of -0.0 - return nt.coefname != dropped_coef || isequal(nt.β, -0.0) + return nt.coefname != dropped_coef || isequal(nt.β, -0.0) end yc = simulate(StableRNG(1), model; β=coef(model))