Learn R Programming

scanstatistics (version 1.0.1)

exponential_priority: Compute exponential priority function values cumulatively over time.

Description

Given a matrices with observed and expected values (baselines) for each timepoint (row) and location/data stream (column), sum counts and baselines cumulatively backwards in time, and compute the exponential priority function value for each column and subset of time.

Usage

exponential_priority(counts, baselines,
  scalar_priority_fun = exponential_qmax)

Arguments

counts

A matrix of observed counts. Rows represent timepoints, ordered from most recent to most distant. Columns represent e.g. locations or data streams.

baselines

A matrix of expected counts with the same dimensions as counts.

scalar_priority_fun

A function taking two arguments c (count) and b (baseline) and returning a scalar.

Value

A matrix with the same dimensions as counts. The \(i\)th element in each column contains the exponential priority function value for the window of time (duration) stretching from 1 to \(i\), for that column.