reulermultinom(n = 1, size, rate, dt)
deulermultinom(x, size, rate, dt, log = FALSE)
rgammawn(n = 1, sigma, dt)
file.show(system.file("include/pomp.h",package="pomp"))to view the pomp.h header file that defines and explains the API.
dn <- reulermultinom(n=m,size=N,rate=r,dt=dt),where
r
is the vector of rates.
Evaluate the probability that $x=(x1,\dots,xk)$ are the numbers of individuals who have died in each of the $k$ ways over the interval $$dt
, by doing deulermultinom(x=x,size=N,rate=r,dt=dt).Breto & Ionides (2011) discuss how an infinitesimally overdispersed death process can be constructed by compounding a binomial process with a Gamma white noise process. The Euler approximation of the resulting process can be obtained as follows. Let the increments of the equidispersed process be given by
reulermultinom(size=N,rate=r,dt=dt).In this expression, replace the rate $r$ with $r {\Delta W}/{\Delta t}$, where $\Delta\!W \sim \mathrm{Gamma}(\Delta\!t/\sigma^2,\sigma^2)$ is the increment of an integrated Gamma white noise process with intensity $\sigma$. That is, $\Delta\!W$ has mean $\Delta\!t$ and variance $\sigma^2 \Delta\!t$. The resulting process is overdispersed and converges (as $\Delta t$ goes to zero) to a well-defined process. The following lines of R code accomplish this:
dW <- rgammawn(sigma=sigma,dt=dt)
dn <- reulermultinom(size=N,rate=r,dt=dW)or
dn <- reulermultinom(size=N,rate=r*dW/dt,dt=dt).He et al. use such overdispersed death processes in modeling measles. For all of the functions described here, access to the underlying C routines is available: see below.
D. He, E. L. Ionides, & A. A. King, Plug-and-play inference for disease dynamics: measles in large and small populations as a case study. J. R. Soc. Interface, 7:271--283, 2010.
print(dn <- reulermultinom(5,size=100,rate=c(a=1,b=2,c=3),dt=0.1))
deulermultinom(x=dn,size=100,rate=c(1,2,3),dt=0.1)
## an Euler-multinomial with overdispersed transitions:
dt <- 0.1
dW <- rgammawn(sigma=0.1,dt=dt)
print(dn <- reulermultinom(5,size=100,rate=c(a=1,b=2,c=3),dt=dW))
Run the code above in your browser using DataLab