Skip to content

Commit

Permalink
fix simulate when only the non pivoted coefs are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Mar 20, 2024
1 parent 0d3cd4b commit 664c003
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/simulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ function simulate!(
θ = convert(Vector{T}, θ)
isempty(θ) || setθ!(m, θ)

# if length(β) ≠ length(m.feterm.piv)
# padding = length(model.feterm.piv) - m.feterm.rank
# append!(β, fill(-0.0, padding))
# end
if length(β) length(m.feterm.piv)
β = invpermute!(copyto!(fill(-0.0, length(m.feterm.piv)), β),
m.feterm.piv)
end

# initialize y to standard normal
randn!(rng, y)
Expand Down Expand Up @@ -247,11 +247,11 @@ function _simulate!(

d = m.resp.d

# if length(β) ≠ length(m.feterm.piv)
# padding = length(model.feterm.piv) - m.feterm.rank
# append!(β, fill(-0.0, padding))
# end

if length(β) length(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 664c003

Please sign in to comment.