|
1 |
| -@testset "turing_model.jl" begin |
| 1 | +@timed_testset "turing_model" begin |
2 | 2 | DATA_DIR = joinpath("..", "data")
|
3 | 3 | kidiq = CSV.read(joinpath(DATA_DIR, "kidiq.csv"), DataFrame)
|
4 | 4 | wells = CSV.read(joinpath(DATA_DIR, "wells.csv"), DataFrame)
|
5 | 5 | roaches = CSV.read(joinpath(DATA_DIR, "roaches.csv"), DataFrame)
|
6 | 6 | cheese = CSV.read(joinpath(DATA_DIR, "cheese.csv"), DataFrame)
|
7 |
| - @testset "Gaussian Model" begin |
| 7 | + @timed_testset "Gaussian Model" begin |
8 | 8 | f = @formula(kid_score ~ mom_iq * mom_hs)
|
9 | 9 | @testset "standardize=false" begin
|
10 | 10 | m = turing_model(f, kidiq)
|
|
38 | 38 | @test quantile(chn)[Symbol("β[2]"), Symbol("50.0%")] ≈ 0.593 atol = 0.2
|
39 | 39 | end
|
40 | 40 | end
|
41 |
| - @testset "Student Model" begin |
| 41 | + @timed_testset "TDist Model" begin |
42 | 42 | f = @formula(kid_score ~ mom_iq * mom_hs)
|
43 | 43 | @testset "standardize=false" begin
|
44 | 44 | m = turing_model(f, kidiq; model=TDist)
|
|
59 | 59 | @test quantile(chn)[:ν, Symbol("50.0%")] ≈ 1.178 atol = 0.5
|
60 | 60 | end
|
61 | 61 | end
|
62 |
| - @testset "Logistic Model" begin |
| 62 | + @timed_testset "Bernoulli Model" begin |
63 | 63 | f = @formula(switch ~ arsenic + dist + assoc + educ)
|
64 | 64 | @testset "standardize=false" begin
|
65 | 65 | m = turing_model(f, wells; model=Bernoulli)
|
|
78 | 78 | @test quantile(chn)[Symbol("β[2]"), Symbol("50.0%")] ≈ -0.009 atol = 0.2
|
79 | 79 | end
|
80 | 80 | end
|
81 |
| - @testset "Pois Model" begin |
| 81 | + @timed_testset "Poisson Model" begin |
82 | 82 | f = @formula(y ~ roach1 + treatment + senior + exposure2)
|
83 | 83 | @testset "standardize=false" begin
|
84 | 84 | m = turing_model(f, roaches; model=Poisson)
|
|
97 | 97 | @test quantile(chn)[Symbol("β[2]"), Symbol("50.0%")] ≈ -0.5145 atol = 0.2
|
98 | 98 | end
|
99 | 99 | end
|
100 |
| - @testset "NegBin Model" begin |
| 100 | + @timed_testset "NegativeBinomial Model" begin |
101 | 101 | f = @formula(y ~ roach1 + treatment + senior + exposure2)
|
102 | 102 | @testset "standardize=false" begin
|
103 | 103 | m = turing_model(f, roaches; model=NegativeBinomial)
|
|
118 | 118 | @test quantile(chn)[:ϕ⁻, Symbol("50.0%")] ≈ 3.56 atol = 0.2
|
119 | 119 | end
|
120 | 120 | end
|
121 |
| - @testset "Hierarchical Model" begin |
| 121 | + @timed_testset "Hierarchical Model" begin |
122 | 122 | f = @formula(y ~ (1 | cheese) + background)
|
123 | 123 | m = turing_model(f, cheese)
|
124 | 124 | chn = sample(seed!(123), m, NUTS(), MCMCThreads(), 2_000, 2)
|
|
0 commit comments