Skip to main content

avg_active_signals

Function avg_active_signals 

Source
pub fn avg_active_signals(
    signal: &[(NaiveDateTime, f64)],
    t1: &[NaiveDateTime],
) -> Vec<(NaiveDateTime, f64)>
Expand description

Averages the signals that are live at each change point (AFML Snippet 10.2).

signal is (start, size) pairs and t1 the matching end times (zipped, so extra entries in the longer slice are ignored). The evaluation points are the sorted, unique union of all starts and ends; at each, the result is the mean of the signals with start <= t < end, or 0 if none is live.