Learn R Programming

scanstatistics (version 0.1.0)

sim_negbin_statistic: Simulate a single negative binomial score scan statistic.

Description

Simulate negative binomial-distributed data according to the supplied parameters and calculate the value of the score scan statistic, according to the specified model.

Usage

sim_negbin_statistic(table, zones, wstat_fun)

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.

wstat_fun

The function that calculates the statistic for each window.

Value

A scalar; the scan statistic for the simulated data.