Description Usage Arguments Examples
deterministic trajectory of SIR
1 2 |
t |
time vector |
params |
parameter vector (beta, gamma, N, i0) |
type |
type of count data |
grad |
(logical) return gradient with respect to unconstrained parameters |
1 2 3 4 5 6 7 8 | pars <- c(beta=0.4,gamma=0.2,N=5000,i0=0.001)
times <- 0:50
ss.p <- SIR.detsim(times,pars)
ss.i <- SIR.detsim(times,pars,type="incidence")
ss.d <- SIR.detsim(times,pars,type="death")
matplot(data.frame(ss.p,ss.i,ss.d),type = "l",xlab="time",ylab="count")
legend(x=0,y=800,col=1:3,lty=1:3,legend=c("prevalence","incidence","death"))
all.equal(cumsum(c(5, ss.i[-length(ss.i)])) - cumsum(c(0, ss.d[-length(ss.d)])), ss.p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.