eulermultinom: The Euler-multinomial distributions and Gamma white-noise...

Description Usage Arguments Details Value C API Author(s) References Examples

Description

This page documents both the Euler-multinomial family of distributions and the package's simulator of Gamma white-noise processes.

Usage

1
2
3
reulermultinom(n = 1, size, rate, dt)
deulermultinom(x, size, rate, dt, log = FALSE)
rgammawn(n = 1, sigma, dt)

Arguments

n

integer; number of random variates to generate.

size

scalar integer; number of individuals at risk.

rate

numeric vector of hazard rates.

sigma

numeric scalar; intensity of the Gamma white noise process.

dt

numeric scalar; duration of Euler step.

x

matrix or vector containing number of individuals that have succumbed to each death process.

log

logical; if TRUE, return logarithm(s) of probabilities.

Details

If N individuals face constant hazards of death in k ways at rates r1,r2,…,rk, then in an interval of duration dt, the number of individuals remaining alive and dying in each way is multinomially distributed:

(N-∑(dni), dn1, …, dnk) ~ multinomial(N;p0,p1,…,pk),

where dni is the number of individuals dying in way i over the interval, the probability of remaining alive is p0=exp(-∑(ri dt)), and the probability of dying in way j is

pj=(1-exp(-sum(ri dt))) rj/(∑(ri)).

In this case, we say that

(dn1,…,dnk)~eulermultinom(N,r,dt),

where r=(r1,…,rk). Draw m random samples from this distribution by doing

1
dn <- reulermultinom(n=m,size=N,rate=r,dt=dt),

where r is the vector of rates. Evaluate the probability that x=(x1,…,xk) are the numbers of individuals who have died in each of the k ways over the interval dt, by doing

1
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

1
reulermultinom(size=N,rate=r,dt=dt).

In this expression, replace the rate r with r {Δ W}/{Δ t}, where Δ\!W \sim \mathrm{Gamma}(Δ\!t/σ^2,σ^2) is the increment of an integrated Gamma white noise process with intensity σ. That is, Δ\!W has mean Δ\!t and variance σ^2 Δ\!t. The resulting process is overdispersed and converges (as Δ t goes to zero) to a well-defined process. The following lines of R code accomplish this:

1
1
dn <- reulermultinom(size=N,rate=r,dt=dW)

or

1
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.

Value

reulermultinom

Returns a length(rate) by n matrix. Each column is a different random draw. Each row contains the numbers of individuals succumbed to the corresponding process.

deulermultinom

Returns a vector (of length equal to the number of columns of x) containing the probabilities of observing each column of x given the specified parameters (size, rate, dt).

rgammawn

Returns a vector of length n containing random increments of the integrated Gamma white noise process with intensity sigma.

C API

An interface for C codes using these functions is provided by the package. At an R prompt, execute

1
file.show(system.file("include/pomp.h",package="pomp"))

to view the header file that defines and explains the API.

Author(s)

Aaron A. King kingaa at umich dot edu

References

C. Breto & E. L. Ionides, Compound Markov counting processes and their applications to modeling infinitesimally over-dispersed systems. Stoch. Proc. Appl., 121:2571–2591, 2011.

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.

Examples

1
2
3
4
5
6
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))

Example output

  [,1] [,2] [,3] [,4] [,5]
a    8   10   11    3   12
b   15   13   13   15   14
c   19   28   26   24   20
[1] 0.0011473661 0.0003457646 0.0003854019 0.0003673386 0.0003899644
  [,1] [,2] [,3] [,4] [,5]
a    7    5    5    6    6
b    8   12   14   13   16
c   17   19   17   15   12

pomp documentation built on May 2, 2019, 4:09 p.m.

Related to eulermultinom in pomp...