Learn R Programming

scanstatistics (version 1.0.1)

estimate_variances: Estimate variances based on observed counts.

Description

Estimate the variances for the supplied counts. It is assumed that variances are constant over time for each location.

Usage

estimate_variances(counts, baselines = NULL, population = NULL,
  constant_dim = 1)

Arguments

counts

A matrix of observed counts. Rows indicate time (ordered from most recent) and columns indicate locations.

baselines

A matrix of the same dimensions as counts (optional).

population

A matrix or vector of populations for each location (optional). If a matrix, should be of the same dimensions as counts. If a vector, should be of the same length as the number of columns in counts.

constant_dim

An integer. If equal to 1, variances are assumed to be constant over time but different between locations. If equal to 2, variances are assumed to vary over time but at each time point be equal for all locations.

Value

A matrix of variances of the same dimensions as counts.