Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bentriou Mahmoud
MarkovProcesses.jl
Commits
5d8c423e
Commit
5d8c423e
authored
Feb 18, 2021
by
Bentriou Mahmoud
Browse files
fix in plots of third notebook
parent
ed3f850c
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/notebooks/3_ABC-SMC_with_ContinuousTimeModel.ipynb
View file @
5d8c423e
%% Cell type:markdown id: tags:
# ABC-SMC with ContinuousTimeModel
The package allows the run of ABC-SMC algorithm with models defined by the package.
%% Cell type:code id: tags:
```
julia
using
MarkovProcesses
using
Distributions
load_model
(
"SIR"
)
set_time_bound!
(
SIR
,
100.0
)
parametric_SIR
=
ParametricModel
(
SIR
,
(
:
ki
,
Uniform
(
0.001
,
0.0015
)))
vec_observations
=
[
simulate
(
SIR
)]
function
dist_obs
(
vec_sim
::
Vector
{
Trajectory
},
vec_observations
::
Vector
{
Trajectory
})
return
dist_lp
(
vec_sim
[
1
],
vec_observations
[
1
];
p
=
2
)
end
epsilon
=
0.5
*
dist_obs
([
simulate
(
SIR
)],
vec_observations
)
@show
epsilon
res_abc
=
abc_smc
(
parametric_SIR
,
vec_observations
,
dist_obs
,
nbr_particles
=
100
,
tolerance
=
epsilon
)
```
%% Cell type:code id: tags:
```
julia
using
Plots
histogram
(
res_abc
.
mat_p_end
,
weights
=
res_abc
.
weights_end
)
histogram
(
vec
(
res_abc
.
mat_p_end
),
weights
=
res_abc
.
weights
)
```
%% Cell type:code id: tags:
```
julia
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment