Learn R Programming

scanstatistics (version 0.1.0)

negbin_mcsim: Monte Carlo simulation of negative binomial score scan statistics.

Description

This function generates n_mcsim negative binomial-distributed data sets according to the parameters in the input table, and calculates the value of the score scan statistic for each generated data set using the supplied zones. The score can be calculated either according to the ordinary cluster model or the increasing outbreak/event/anomaly model.

Usage

negbin_mcsim(table, zones, n_mcsim, version = "ordinary")

Arguments

table

A data.table with at least the columns mu and theta. The parameter \(\theta\) (theta) is the same as size in rnbinom.

zones

A set of zones, each zone itself being a set containing locations. Locations should be encoded as integers.

n_mcsim

A positive integer; the number of replicate scan statistics to generate.

version

Either "ordinary" (default) or "increasing".

Value

A numeric vector of length n_mcsim.