lazyABC: Perform lazy ABC algorithm

Description Usage Arguments Details Value

Description

Perform rejection sampling lazy ABC on the SIR epidemic example or, as a special case, perform ordinary ABC

Usage

1
2
lazyABC(yobs, n.its, eps, stopstep, alpha = NULL, parallel = TRUE,
  S0 = 1e+06, I0 = 1, R0 = 0, n.subsample = 100, quiet = FALSE)

Arguments

yobs

Observed number recovered

n.its

Number of iterations to perform

eps

ABC threshold

stopstep

When to consider early stopping (set to Inf for ordinary ABC)

alpha

Continuation probability function: a function of one non-negative integer (number infectious) which returns a scalar in [0,1]. Leave NULL for ordinary ABC.

parallel

If TRUE iterations are performed in parallel

S0

Initial number susceptible

I0

Initial number infectious

R0

Initial number recovered

n.subsample

Size of subsample

quiet

Whether to suppress progress messages

Details

Prior is gamma=1 and beta~Gamma(5,1) (equivalently R0~Gamma(5,1)) Random seeds 1:n.its are used for the simulations. This is done in such a way that the ith simulation, if run to completion, will be the same regardless of alpha.

Value

A list comprising: ABCsample - dataframe of R0, weight, dist and phi; time - sum of elapsed time in each core. n.b. dist is ABC distance and phi is the decision statistic, I(stopstep).


dennisprangle/lazyABCexample documentation built on May 15, 2019, 3:25 a.m.