MCPcopy Create free account
hub / github.com/Open-Quant/openquant / register

Function register

crates/pyopenquant/src/structural_breaks.rs:40–48  ·  view source on GitHub ↗
(py: Python<'_>, parent: &Bound<'_, PyModule>)

Source from the content-addressed store, hash-verified

38}
39
40/// Chu-Stinchcombe-White CUSUM test on levels, with its critical values.
41///
42/// AFML §17.3.2. For each bar `t` from index 2 on, `sigma_t^2` is the mean of the squared
43/// one-bar changes up to `t`, and the statistic is
44/// `S_t = max_{n < t} (y_t - y_n) / (sigma_t * sqrt(t - n))` (absolute difference for
45/// `"two_sided"`). The critical value is `sqrt(4.6 + ln(t - n))` at the maximising `n`.
46///
47/// Parameters
48/// ----------
49/// log_prices : list[float]
50/// Log prices, oldest first; at least three.
51/// test_type : str

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected