Compute the most likely cluster (MLC) with the Subset Aggregation method by Neill et al. (2013), either through fast optimization over subsets of locations and naive optimization over subsets of streams (FN), or through naive optimization over subsets of locations and fast optimization over subsets of streams (NF).
subset_aggregation_FN_NF(args, score_fun = poisson_score,
priority_fun = poisson_priority, algorithm = "FN")
A list of arrays:
Required. An array of counts (integer or numeric). First dimension is time, ordered from most recent to most distant. Second dimension indicates locations, which will be enumerated from 1 and up. Third dimension indicates data streams, which will be enumerated from 1 and up.
Required. A matrix of expected counts. Dimensions are
as for counts
.
Optional. A matrix of penalty terms. Dimensions are as
for counts
.
Optional. More matrices with distribution parameters.
Dimensions are as for counts
.
A function taking matrix arguments, all of the
same dimension, and returning a matrix or vector of that dimension.
Suitable alternatives are poisson_score
,
gaussian_score
.
A function taking matrix arguments, all of the
same dimension, and returning a matrix or vector of that dimension.
Suitable alternatives are poisson_priority
,
gaussian_priority
.
Either "FN" or "NF":
Fast optimization over subsets of locations and naive optimization over subsets of streams. Can be used if the number of data streams is small.
Fast optimization over subsets of streams and naive optimization over subsets of locations. Can be used if the number of locations is small.
A list with 4 elements:
A scalar; the score of the MLC.
An integer; the duration of the MLC, i.e. how many time periods from the present into the past the MLC stretches.
An integer vector; the locations contained in the MLC.
An integer vector; the data streams contained in the MLC.
Neill, Daniel B., Edward McFowland, and Huanian Zheng (2013). Fast subset scan for multivariate event detection. Statistics in Medicine 32 (13), pp. 2185-2208.