Skip to content

Commit

Permalink
A test using a deep copy of a model should reset the initial paramete…
Browse files Browse the repository at this point in the history
…r values. (#744)
  • Loading branch information
dmbates committed Feb 20, 2024
1 parent 6fde5ca commit 529c710
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/matrixterm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ end
@test typeof(X.x) <: SparseMatrixCSC
@test X.rank == 28
@test X.cnames == fe.cnames
m1 = fit!(LinearMixedModel(collect(m.y), X, deepcopy(m.reterms), m.formula); progress=false)
m1 = LinearMixedModel(collect(m.y), X, deepcopy(m.reterms), m.formula)
# because of the way the initial values are calculated
# m1.optsum.initial == m.optsum.final at this point
copyto!(m1.optsum.initial, m.optsum.initial)
fit!(m1; progress=false)
@test isapprox(m1.θ, m.θ, rtol = 1.0e-5)
end

Expand Down

0 comments on commit 529c710

Please sign in to comment.