Functions break_signal() and signal_processor() are designed to select the best break of a “signal”, observed differences in the values of an ordered sequence. A “break” is simply a change in sign of the differences: the “best” break is the one that indicates the process that generates of observations has changed state.

break_signal(
  y = integer(0),
  k = 0,
  grp = NULL,
  obs_ctrl = list(min_size = 1L, max_k = 2L),
  best_k = numeric(0),
  alt_k = numeric(0),
  k_sz = numeric(0),
  score = numeric(0),
  data = NULL
)

Slots

y

The un-transformed, monotonically ordered vector. If using dates, these values will be coerced into seconds. For other units of time, convert them into numeric values using code like the following: y / as.numeric(lubridate::dhours(1))

k

(used internally)

grp

A vector containing group assignments along y

obs_ctrl

(list) Observation data control list having the following recognized elements:

  • max_k: The upper limit for breaks to allow under consideration. This should primarily be set to control the effects of extreme values that appear frequently enough to be non-trivial but are due to confounding factors not related to the generative process under study.

  • min_size: The minimum observation size at each k to allow

best_k,alt_k

(numeric) Entropy-based optimized (and next best) break in the signal (passively set by signal_processor)

k_sz

(numeric) The observation size at each k (passively set by signal_processor)

score

(numeric[]) The scoring vector at each k (passively set by signal_processor)

data

The generated data for which scores are generated (passively set by signal_processor)

plot

A plot_ly visualization after break optimization (passively set by signal_processor)