Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic JuliaFormatter.jl run #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ makedocs(;
),
pages = [
"Home" => "index.md",
# "Example: Gaussian Mixture" => "example_1.md",
# "Example: Gaussian Mixture" => "example_1.md",
#"Reference" => "reference.md",
],
)
Expand Down
2 changes: 1 addition & 1 deletion examples/example_n1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ res = sample(

# You can also use Sequential Monte Carlo (SMC) to infer posterior parameters:

ressmc = smc(prior, cost, nparticles=500, epstol=0.01)
ressmc = smc(prior, cost, nparticles = 500, epstol = 0.01)

@show ressmc

Expand Down
6 changes: 3 additions & 3 deletions examples/example_n2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function model(P, N)

d1 = @. r1 * σ_1 + μ_1
d2 = @. r1 * σ_2 + μ_2
ps = @. (1 + sign(r2 - prob))/2
@. (d1+ps*(d2-d1))
ps = @. (1 + sign(r2 - prob)) / 2
@. (d1 + ps * (d2 - d1))

end

Expand Down Expand Up @@ -56,5 +56,5 @@ approx_density = ApproxPosterior(prior, D, 0.032)
@show res

# In this case, it is best to apply SMC, as it leads to tighter CI's and lower computational costs
@time res = smc(prior, D, verbose=false, nparticles=100, alpha=0.95)
@time res = smc(prior, D, verbose = false, nparticles = 100, alpha = 0.95)
@show res.P
5 changes: 3 additions & 2 deletions src/KissABC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ function AbstractMCMC.step(
particles[i] = op(float, unconditional_sample(rng, model))
logdensity[i] = loglike(model, push_p(model, particles[i]))
retrys -= 1
retrys < 0 &&
error("Prior leads to ∞ costs too often, tune the prior or increase `retry_sampling`.")
retrys < 0 && error(
"Prior leads to ∞ costs too often, tune the prior or increase `retry_sampling`.",
)
end
end

Expand Down
Loading