@@ -37,32 +37,40 @@ include("util.jl")
3737 # Set up our sampler with initial parameters.
3838 spl1 = StaticMH ([Normal (0 ,1 ), Normal (0 , 1 )])
3939 spl2 = StaticMH (MvNormal (zeros (2 ), I))
40+ spl3 = StaticMH (2 )
4041
4142 # Sample from the posterior.
4243 chain1 = sample (model, spl1, 100000 ; chain_type= StructArray, param_names= [" μ" , " σ" ])
4344 chain2 = sample (model, spl2, 100000 ; chain_type= StructArray, param_names= [" μ" , " σ" ])
45+ chain3 = sample (model, spl3, 100000 ; chain_type= StructArray, param_names= [" μ" , " σ" ])
4446
4547 # chn_mean ≈ dist_mean atol=atol_v
4648 @test mean (chain1. μ) ≈ 0.0 atol= 0.1
4749 @test mean (chain1. σ) ≈ 1.0 atol= 0.1
4850 @test mean (chain2. μ) ≈ 0.0 atol= 0.1
4951 @test mean (chain2. σ) ≈ 1.0 atol= 0.1
52+ @test mean (chain3. μ) ≈ 0.0 atol= 0.1
53+ @test mean (chain3. σ) ≈ 1.0 atol= 0.1
5054 end
5155
5256 @testset " RandomWalk" begin
5357 # Set up our sampler with initial parameters.
5458 spl1 = RWMH ([Normal (0 ,1 ), Normal (0 , 1 )])
5559 spl2 = RWMH (MvNormal (zeros (2 ), I))
60+ spl3 = RWMH (2 )
5661
5762 # Sample from the posterior.
5863 chain1 = sample (model, spl1, 100000 ; chain_type= StructArray, param_names= [" μ" , " σ" ])
5964 chain2 = sample (model, spl2, 100000 ; chain_type= StructArray, param_names= [" μ" , " σ" ])
65+ chain3 = sample (model, spl3, 200000 ; chain_type= StructArray, param_names= [" μ" , " σ" ])
6066
6167 # chn_mean ≈ dist_mean atol=atol_v
6268 @test mean (chain1. μ) ≈ 0.0 atol= 0.1
6369 @test mean (chain1. σ) ≈ 1.0 atol= 0.1
6470 @test mean (chain2. μ) ≈ 0.0 atol= 0.1
6571 @test mean (chain2. σ) ≈ 1.0 atol= 0.1
72+ @test mean (chain3. μ) ≈ 0.0 atol= 0.1
73+ @test mean (chain3. σ) ≈ 1.0 atol= 0.1
6674 end
6775
6876 @testset " parallel sampling" begin
0 commit comments