From 529c71000f5b520dad0b512c57c548a0c3768cfc Mon Sep 17 00:00:00 2001 From: Douglas Bates Date: Tue, 20 Feb 2024 09:44:09 -0600 Subject: [PATCH] A test using a deep copy of a model should reset the initial parameter values. (#744) --- test/matrixterm.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/matrixterm.jl b/test/matrixterm.jl index 6ac9ea24c..b076ff65b 100644 --- a/test/matrixterm.jl +++ b/test/matrixterm.jl @@ -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