run_qd: Quickest Detection calculation

Description Usage Arguments Value Examples

View source: R/quickest_detection.R

Description

Quickest Detection calculation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
run_qd(
  rolling_window_stats,
  var_cols,
  widths = c(21),
  stats_to_qd = c("SD", "Ar1"),
  A_adj = 1e+07,
  exp_lakes = c("R", "T"),
  ref_lake = "L",
  ar1_alarm_rho = 0.95
)

Arguments

rolling_window_stats

data frame of rolling window statistics that is output from calc_rolling_stats

var_cols

character vector, variable names that are columns of *data* containing time series to calculate quickest detection stats on

widths

numeric vector, rolling window width(s) to be used, default is c(21)

stats_to_qd

character vector, rolling window statistics to run quickest detection method on, defaults to all available: c("sd", "Ar1")

A_adj

numeric, the threshold in the S-R statistic at which an alarm is triggered

exp_lakes

character vector, values in *Lake* column of *rolling_window_stats* that correspond to experimental lakes

ref_lake

character vector, values in *Lake* column of *rolling_window_stats* that correspond to the reference lake

ar1_alarm_rho

numeric value between 0 and 1 (exclusive), 'true' value of lag-1 autocorrelation in alarm state, default is 0.95

Value

a data frame of values from the quickest detection method; TODO add more details on columns

Examples

1
2
rw_stats <- calc_rolling_stats(ts_data, var_cols = c("DO_Sat"))
qd_stats <- run_qd(rw_stats, var_cols = c("DO_Sat"))

cbuelo/tvsews documentation built on Jan. 21, 2022, 1:31 a.m.