Calculate the ordinary negative binomial score for each space-time window, given the initial data of counts, expected values, and overdispersion parameters.
negbin_calculations(table, zones)
A data.table
with columns location, duration, mu,
theta, count
. The location
column should consist of integers that
are unique to each location. The duration
column should also
consist of integers, starting at 1 for the most recent time period and
increasing in reverse chronological order.
A negative binomial distribution parametrized by \(\mu\) and
\(\theta\) (columns mu
and theta
respectively) has
expected value \(\mu\) and variance \(\mu+\mu^2/\theta\). The
parameter \(\theta\) is referred to as the size
in
NegBinomial
, and theta
in
negative.binomial
.
A set
of zones, each zone itself a
set containing one or more locations of those found in table
.
A data.table
with columns zone, duration, statistic
.