Skip to content

Commit

Permalink
Merge branch 'pa/simulate_fixef' of github.com:JuliaStats/MixedModels…
Browse files Browse the repository at this point in the history
….jl into pa/simulate_fixef
  • Loading branch information
palday committed Mar 20, 2024
2 parents 61090e8 + 5eaac8f commit 01a84ac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/simulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ function simulate!(
isempty(θ) || setθ!(m, θ)

if length(β) length(m.feterm.piv)
β = invpermute!(copyto!(fill(-0.0, length(m.feterm.piv)), β),
m.feterm.piv)
β = invpermute!(copyto!(fill(-0.0, length(m.feterm.piv)), β),
m.feterm.piv)
end

# initialize y to standard normal
Expand Down Expand Up @@ -248,10 +248,9 @@ function _simulate!(
d = m.resp.d

if length(β) length(m.feterm.piv)
β = invpermute!(copyto!(fill(-0.0, length(m.feterm.piv)), β),
m.feterm.piv)
β = invpermute!(copyto!(fill(-0.0, length(m.feterm.piv)), β),
m.feterm.piv)
end

fast = (length(m.θ) == length(m.optsum.final))
setpar! = fast ? setθ! : setβθ!
params = fast ? θ : vcat(β, θ)
Expand Down

0 comments on commit 01a84ac

Please sign in to comment.