(
test_type: &str,
series: &[f64],
index: usize,
ind: usize,
)
| 119 | } |
| 120 | |
| 121 | pub fn _get_values_diff( |
| 122 | test_type: &str, |
| 123 | series: &[f64], |
| 124 | index: usize, |
| 125 | ind: usize, |
| 126 | ) -> StructuralBreakResult<f64> { |
| 127 | let left = series.get(index).ok_or(StructuralBreakError::IndexOutOfBounds)?; |
| 128 | let right = series.get(ind).ok_or(StructuralBreakError::IndexOutOfBounds)?; |
| 129 | match test_type { |
| 130 | "one_sided" => Ok(left - right), |
| 131 | "two_sided" => Ok((left - right).abs()), |
| 132 | _ => Err(StructuralBreakError::InvalidTestType(test_type.to_string())), |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | pub fn _get_betas( |
| 137 | _x: &[Vec<f64>], |
no outgoing calls