File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ dimension(t::CorrCholeskyFactor) = unit_triangular_dimension(t.n)
9797
9898function transform_with (flag:: LogJacFlag , t:: CorrCholeskyFactor , x:: RealVector )
9999 @unpack n = t
100+ @argcheck length (x) == dimension (t)
100101 T = extended_eltype (x)
101102 ℓ = logjac_zero (flag, T)
102103 U = Matrix {T} (undef, n, n)
Original file line number Diff line number Diff line change 8181end
8282
8383@testset " to correlation cholesky factor" begin
84- for K in 1 : 8
85- t = CorrCholeskyFactor (K)
86- @test dimension (t) == (K - 1 )* K/ 2
87- CIENV && @info " testing correlation cholesky K = $(K) "
88- if K > 1
89- test_transformation (t, is_valid_corr_cholesky;
90- vec_y = vec_above_diagonal, N = 100 )
84+ @testset " dimension checks" begin
85+ C = CorrCholeskyFactor (3 )
86+ wrong_x = zeros (dimension (C) + 1 )
87+
88+ @test_throws ArgumentError C (wrong_x)
89+ @test_throws ArgumentError transform (C, wrong_x)
90+ @test_throws ArgumentError transform_and_logjac (C, wrong_x)
91+ end
92+
93+ @testset " consistency checks" begin
94+ for K in 1 : 8
95+ t = CorrCholeskyFactor (K)
96+ @test dimension (t) == (K - 1 )* K/ 2
97+ CIENV && @info " testing correlation cholesky K = $(K) "
98+ if K > 1
99+ test_transformation (t, is_valid_corr_cholesky;
100+ vec_y = vec_above_diagonal, N = 100 )
101+ end
91102 end
92103 end
93104end
You can’t perform that action at this time.
0 commit comments