Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MarkovProcesses.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bentriou Mahmoud
MarkovProcesses.jl
Commits
190833bb
Commit
190833bb
authored
4 years ago
by
Bentriou Mahmoud
Browse files
Options
Downloads
Patches
Plain Diff
small fix in abc when eps is infinity
parent
8c673bae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algorithms/abc_smc.jl
+7
-8
7 additions, 8 deletions
algorithms/abc_smc.jl
with
7 additions
and
8 deletions
algorithms/abc_smc.jl
+
7
−
8
View file @
190833bb
...
...
@@ -177,8 +177,7 @@ function _abc_smc(pm::ParametricModel, nbr_particles::Int, tolerance::Float64, a
old_epsilon
=
epsilon
end
mat_p
=
mat_p_old
mat_cov
=
cov
(
mat_p
,
ProbabilityWeights
(
wl_old
),
2
;
corrected
=
false
)
mat_cov
=
cov
(
mat_p_old
,
ProbabilityWeights
(
wl_old
),
2
;
corrected
=
false
)
if
dir_results
!=
nothing
writedlm
(
dir_results
*
"weights_end.csv"
,
wl_old
,
','
)
writedlm
(
dir_results
*
"mat_p_end.csv"
,
mat_p_old
,
','
)
...
...
@@ -191,7 +190,7 @@ function _abc_smc(pm::ParametricModel, nbr_particles::Int, tolerance::Float64, a
write
(
file_cfg
,
"Number of threads:
$
(Threads.nthreads())
\n
"
)
close
(
file_cfg
)
end
r
=
ResultAbc
(
mat_p
,
mat_cov
,
nbr_tot_sim
,
time
()
-
begin_time
,
vec_dist
,
epsilon
,
wl_old
,
l_ess
)
r
=
ResultAbc
(
mat_p
_old
,
mat_cov
,
nbr_tot_sim
,
time
()
-
begin_time
,
vec_dist
,
old_
epsilon
,
wl_old
,
l_ess
)
return
r
end
...
...
@@ -285,12 +284,12 @@ function _distributed_abc_smc(pm::ParametricModel, nbr_particles::Int, tolerance
flush
(
stdout
)
old_epsilon
=
epsilon
end
mat_cov
=
cov
(
mat_p
,
ProbabilityWeights
(
wl_old
),
2
;
corrected
=
false
)
mat_cov
=
cov
(
mat_p
_old
,
ProbabilityWeights
(
wl_old
),
2
;
corrected
=
false
)
save_mat_p_end
=
true
if
dir_results
!=
nothing
writedlm
(
dir_results
*
"weights_end.csv"
,
wl_
current
,
','
)
writedlm
(
dir_results
*
"mat_p_end.csv"
,
mat_p
,
','
)
writedlm
(
dir_results
*
"weights_end.csv"
,
wl_
old
,
','
)
writedlm
(
dir_results
*
"mat_p_end.csv"
,
mat_p
_old
,
','
)
file_cfg
=
open
(
dir_results
*
"results_abc.out"
,
"w"
)
write
(
file_cfg
,
"
\n
"
)
write
(
file_cfg
,
"About the results:
\n
"
)
...
...
@@ -300,7 +299,7 @@ function _distributed_abc_smc(pm::ParametricModel, nbr_particles::Int, tolerance
write
(
file_cfg
,
"Number of threads:
$
(Threads.nthreads())
\n
"
)
close
(
file_cfg
)
end
r
=
ResultAbc
(
mat_p
,
mat_cov
,
nbr_tot_sim
,
time
()
-
begin_time
,
convert
(
Array
,
d_vec_dist
),
epsilon
,
wl_
current
,
l_ess
)
r
=
ResultAbc
(
mat_p
_old
,
mat_cov
,
nbr_tot_sim
,
time
()
-
begin_time
,
convert
(
Array
,
d_vec_dist
),
old_
epsilon
,
wl_
old
,
l_ess
)
return
r
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment