Learn R Programming

scanstatistics (version 1.1.1)

scan_eb_zip_cpp: Calculate the highest-value EB ZIP loglihood ratio statistic.

Description

Calculate the expectation-based ZIP loglihood ratio statistic for each zone and duration, but only keep the zone and duration with the highest value (the MLC). The estimate of the relative risk is also calculated, along with the number of iterations the EM algorithm performed.

Usage

scan_eb_zip_cpp(
  counts,
  baselines,
  probs,
  zones,
  zone_lengths,
  rel_tol,
  store_everything,
  num_mcsim
)

Value

A list with elements observed and simulated, each being a data frame with columns:

zone

The top-scoring zone (spatial component of MLC).

duration

The corresponding duration (time-length of MLC).

score

The value of the loglihood ratio statistic (the scan statistic).

relrisk

The estimated relative risk.

n_iter

The number of iterations performed by the EM algorithm.

Arguments

counts

matrix (most recent timepoint in first row)

baselines

matrix (most recent timepoint in first row)

probs

matrix (most recent timepoint in first row)

zones

integer vector (all zones concatenated; locations indexed from 0 and up)

zone_lengths

integer vector

rel_tol

double

store_everything

boolean

num_mcsim

int