Skip to content

Commit

Permalink
make some tests more tolerant
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sabanes Bove committed Jun 25, 2024
1 parent a8152d9 commit d5e0619
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/test_fit_beta_mixture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ end
@test mix_fit.components[1].β β₂ rtol = 0.1
@test mix_fit.components[2].α α₁ rtol = 0.1
@test mix_fit.components[2].β β₁ rtol = 0.1
@test mix_fit.prior.p[1] 1 - π rtol = 0.01
@test mix_fit.prior.p[2] π rtol = 0.01
@test mix_fit.prior.p[1] 1 - π rtol = 0.1
@test mix_fit.prior.p[2] π rtol = 0.1
end

@testset "Check that fit_beta_mixture can fit the mean and standard deviation of samples well" begin
Expand All @@ -54,6 +54,6 @@ end
normal_dist = Normal(0.5, 0.05)
y = rand(normal_dist, N)
fit_y = fit_beta_mixture(y, 2)
@test mean(fit_y) mean(y) rtol = 0.02
@test mean(fit_y) mean(y) rtol = 0.1
@test std(fit_y) std(y) rtol = 0.1
end
4 changes: 2 additions & 2 deletions test/test_fit_mle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
@test mix_mle.components[1].β β₂ rtol = 0.1
@test mix_mle.components[2].α α₁ rtol = 0.1
@test mix_mle.components[2].β β₁ rtol = 0.1
@test mix_mle.prior.p[1] 1 - π rtol = 0.01
@test mix_mle.prior.p[2] π rtol = 0.01
@test mix_mle.prior.p[1] 1 - π rtol = 0.1
@test mix_mle.prior.p[2] π rtol = 0.1
end

0 comments on commit d5e0619

Please sign in to comment.