File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 99
99
@test logdensity (Dirac (0.3 ), 0.4 ) == - Inf
100
100
end
101
101
102
+ @testset " AffineTransform" begin
103
+ f = AffineTransform ((μ= 3 ,σ= 2 ))
104
+ @test f (inv (f)(1 )) == 1
105
+ @test inv (f)(f (1 )) == 1
106
+
107
+ g = AffineTransform ((μ= 3 ,ω= 2 ))
108
+ @test g (inv (g)(1 )) == 1
109
+ @test inv (g)(g (1 )) == 1
110
+ end
111
+
112
+ @testset " Affine" begin
113
+ unif = ∫ (x -> 0 < x< 1 , Lebesgue (ℝ))
114
+ f = AffineTransform ((μ= 3 ,σ= 2 ))
115
+ g = AffineTransform ((μ= 3 ,ω= 2 ))
116
+
117
+ @test Affine ((μ= 3 ,σ= 2 ))(unif) == Affine (f, unif)
118
+ @test Affine ((μ= 3 ,ω= 2 ))(unif) == Affine (g, unif)
119
+ @test_broken logdensity (Affine (f, Affine (inv (f), unif)), 0.5 ) == 1
120
+ end
121
+
102
122
# @testset "For" begin
103
123
# FORDISTS = [
104
124
# For(1:10) do j Normal(μ=j) end
You can’t perform that action at this time.
0 commit comments