siragemod {epimdr} | R Documentation |
Gradient-function for the age-structured SIR model with possibly heterogeneous mixin
siragemod(t, logx, parms)
t |
Implicit argument for time |
logx |
A vector with log-values for the log-states |
parms |
A vector with parameter values for the age-structured SIR system |
A list of gradients
a=rep(1,4) n=length(a) betaM=matrix(1, ncol=4, nrow=4) pars =list(N=1, gamma=365/14, mu=0.02, sigma=0.2, beta=500, betaM=betaM,p=rep(0,4), a=a) xstart<-log(c(S=rep(0.099/n,n), I=rep(0.001/n,n), R=rep(0.9/n,n))) times=seq(0,10,by=14/365) out=as.data.frame(ode(xstart, times=times, func=siragemod, parms=pars))