Skip to content

Commit

Permalink
Attempting to solve errors in CI due to bad IntegralProblem call
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Chlebicki committed May 9, 2024
1 parent 07d1821 commit 31010f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: CI
on:
push:
branches:
- main
- '**'
tags: ['*']
pull_request:
branches:
- '**'
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.jl.cov
*.jl.mem
/Manifest.toml
test_code.jl
test_code.jl
test_code_polish_data.jl
4 changes: 3 additions & 1 deletion src/binomial_model_sampling_random_effect.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ function sample_u_cond_random_eff(n, N, m, M, γ₁, γ₂; prec = 40)
setprecision(prec) do
# TODO:: this could be much faster if broadcasted but GaussLegendre() doesn't work in R^d where d=>2
f(x, p) = exp(BigFloat(m[k] * log(x) + (M - m)[k] * log(1 - x * μ[k]) + logpdf(beta_distr[k], x)))
ff(x) = solve(IntegralProblem(f, [0, x]), GaussLegendre(), reltol = 1e-10, abstol = 1e-10)
# TODO this fails for older integrals.jl versions
prob = IntegralProblem(f, (0, x))
ff(x) = solve(prob, GaussLegendre(), reltol = 1e-10, abstol = 1e-10)
R = ff(1)
a = optimize(x -> (ff(x)[1] / R[1] - U[k]) ^ 2, 0, 1, Brent(), rel_tol = 1e-10)
push!(res, a.minimizer)
Expand Down

0 comments on commit 31010f7

Please sign in to comment.