Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
annabellasd committed Sep 28, 2023
1 parent ab24bd6 commit f0317ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lectures/continuous_time/covid_sde.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ We will shut down the shocks to the mortality rate (i.e. $\xi = 0$) to focus on
Consider $\eta = 1/50$ and $\eta = 1/20$, where we start at the same initial condition of $R_0(0) = 0.5$.

```{code-cell} julia
function generate_eta_experiment(eta; p_gen, trajectories = 100, saveat = 1.0, x_0, T = 120.0)
function generate_eta_experiment(eta; p_gen = p_gen, trajectories = 100, saveat = 1.0, x_0 = x_0, T = 120.0)
p = p_gen(eta = eta, xi = 0.0)
ensembleprob = EnsembleProblem(SDEProblem(F, G, x_0, (0, T), p))
sol = solve(ensembleprob, SOSRI(), EnsembleThreads(), trajectories = trajectories, saveat = saveat)
Expand Down
6 changes: 3 additions & 3 deletions lectures/continuous_time/seir_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ First, construct our $F$ from {eq}`dfcv`
```{code-cell} julia
function F(x, p, t)
s, e, i, r, R_0, c, d = x
(;sigma, gamma, R_0_bar, eta, delta) = p
(;sigma, gamma, R_bar_0, eta, delta) = p
return [-gamma * R_0 * s * i; # ds/dt
gamma * R_0 * s * i - sigma * e; # de/dt
Expand All @@ -313,9 +313,9 @@ The only confusing part of the notation is the `R_0(t, p)` which evaluates the `
The baseline parameters are put into a named tuple generator (see previous lectures using [Parameters.jl](https://github.com/mauro3/Parameters.jl)) with default values discussed above.

```{code-cell} julia
p_gen(T = 550.0, gamma = 1.0 / 18, sigma = 1 / 5.2, eta = 1.0 / 20,
p_gen(;T = 550.0, gamma = 1.0 / 18, sigma = 1 / 5.2, eta = 1.0 / 20,
R_0_n = 1.6, delta = 0.01, N = 3.3E8,
R_0_bar = (t, p) -> p.R_0_n) = (T, gamma, sigma, eta, R_0_n, delta, N, R_0_bar)
R_bar_0 = (t, p) -> p.R_0_n) = (;T, gamma, sigma, eta, R_0_n, delta, N, R_bar_0)
```

Note that the default $\bar{R}_0(t)$ function always equals $R_{0n}$ -- a parameterizable natural level of $R_0$ used only by the `R_hat_0` function
Expand Down

0 comments on commit f0317ce

Please sign in to comment.