scan_eb_zip_cpp {scanstatistics} | R Documentation |
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
)
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 |
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.