Registry / Library

library · v0.1.0
CUSUM
Detect persistent shifts in a sequence of standardized observations with a two-sided cumulative sum.
Use CUSUM
use vendor::cusum::cusum;
Run the example
nest demo cusum@0.1.0
blyxc native-run cusum-demo/main.blyx
Example source and expected output
use vendor::cusum::cusum;
fn main() {
let mut state = cs_empty();
let observations = [2, 2, -3.5];
let mut i = 0;
while i < len(observations) {
state = cs_step(state, at(observations, i), 0.5, 3.0);
println!(at(state, 2));
i += 1;
}
}
Expected output
0
1
-1
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.0 | Download ZIP | 4e99a0509d | 00b7667c058123f62b3b6dce774d834a210a059f57b412a74821ba10ba291847 |