tests/testthat/stochastic/sir_discrete.R

update(S) <- S - beta * S * I / N
update(I) <- I + beta * S * I / N - gamma * I
update(R) <- R + gamma * I

initial(S) <- S0
initial(I) <- 10
initial(R) <- 0

S0 <- user(100)
beta <- user(0.1)
gamma <- user(0.1)

N <- S + I + R

Try the odin package in your browser

Any scripts or data that you put into this service are public.

odin documentation built on April 28, 2022, 9:05 a.m.