@@ -130,8 +130,13 @@ test_scenario = (scenario) -> begin
130130 ϕunc_true. logσ2_ζP = (log ∘ abs2). (sd_ζP_true)
131131 ϕunc_true. coef_logσ2_ζMs[1 ,:] = (log ∘ abs2). (sd_ζMs_a_true)
132132 ϕunc_true. coef_logσ2_ζMs[2 ,:] = logσ2_ζMs_b_true
133- ϕunc_true. ρsP = ρsP_true
134- ϕunc_true. ρsM = ρsM_true
133+ # note that the parameterization contains a transformation that
134+ # here only inverted for the single correlation case
135+ ϕunc_true. ρsP = CP. compute_cholcor_coefficient_single .(ρsP_true)
136+ ϕunc_true. ρsM = CP. compute_cholcor_coefficient_single .(ρsM_true)
137+ # check that ρsM_true = -0.6 recovered with params ϕunc_true.ρsM = -0.75
138+ UC = CP. transformU_cholesky1 (ϕunc_true. ρsM); Σ = UC' * UC
139+ @test Σ[1 ,2 ] ≈ ρsM_true[1 ]
135140
136141 probd = CP. update (probc; ϕunc= ϕunc_true);
137142 _ϕ = vcat (ϕ_ini. μP, probc. ϕg, probd. ϕunc)
@@ -189,12 +194,12 @@ test_scenario = (scenario) -> begin
189194 residPMst = vcat (residP,
190195 reshape (residMst, size (residMst,1 )* size (residMst,2 ), size (residMst,3 )))
191196 cor_PMs = cor (residPMst' )
192- @test cor_PMs[1 ,2 ] ≈ ρsP_true[1 ] atol= 0.2
193- @test all (.≈ (cor_PMs[1 : 2 ,3 : end ], 0.0 , atol= 0.2 )) # no correlations P,M
194- @test cor_PMs[3 ,4 ] ≈ ρsM_true[1 ] atol= 0.2
195- @test all (.≈ (cor_PMs[3 : 4 ,5 : end ], 0.0 , atol= 0.2 )) # no correlations M1, M2
196- @test cor_PMs[5 ,6 ] ≈ ρsM_true[1 ] atol= 0.2
197- @test all (.≈ (cor_PMs[5 : 6 ,7 : end ], 0.0 , atol= 0.2 )) # no correlations M1, M2
197+ @test cor_PMs[1 ,2 ] ≈ ρsP_true[1 ] atol= 0.02
198+ @test all (.≈ (cor_PMs[1 : 2 ,3 : end ], 0.0 , atol= 0.02 )) # no correlations P,M
199+ @test cor_PMs[3 ,4 ] ≈ ρsM_true[1 ] atol= 0.02
200+ @test all (.≈ (cor_PMs[3 : 4 ,5 : end ], 0.0 , atol= 0.02 )) # no correlations M1, M2
201+ @test cor_PMs[5 ,6 ] ≈ ρsM_true[1 ] atol= 0.02
202+ @test all (.≈ (cor_PMs[5 : 6 ,7 : end ], 0.0 , atol= 0.02 )) # no correlations M1, M2
198203 end
199204 test_distζ (_ζsP, _ζsMs, ϕunc_true, ζMs_g)
200205 @testset " predict_hvi check sd" begin
0 commit comments