diff --git a/Project.toml b/Project.toml index ce2fae1..2fead9c 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ version = "1.2.2" [deps] JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" +ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RobustPmap = "27aeedcb-f738-516b-a0b8-3211cf1146e5" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" @@ -11,6 +12,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] JLD2 = "0.4, 0.5, 1" +ProgressMeter = "1" RobustPmap = "1" Statistics = "1, 2" julia = "1.9" diff --git a/src/AffineInvariantMCMC.jl b/src/AffineInvariantMCMC.jl index 9c85ed9..40880aa 100644 --- a/src/AffineInvariantMCMC.jl +++ b/src/AffineInvariantMCMC.jl @@ -7,6 +7,7 @@ Module: AffineInvariantMCMC module AffineInvariantMCMC import RobustPmap +import ProgressMeter import Random const emceedir = splitdir(splitdir(pathof(AffineInvariantMCMC))[1])[1] @@ -53,7 +54,7 @@ function sample(llhood::Function, numwalkers::Integer, x0::AbstractMatrix, numsa batch1 = 1:div(numwalkers, 2) batch2 = div(numwalkers, 2) + 1:numwalkers divisions = [(batch1, batch2), (batch2, batch1)] - for i = 1:numsamples_perwalker + @ProgressMeter.showprogress 5 for i = 1:numsamples_perwalker for ensembles in divisions active, inactive = ensembles zs = map(u->((a - 1) * u + 1)^2 / a, rand(rng, length(active)))