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

Function register

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

Source from the content-addressed store, hash-verified

21#[pyfunction(name = "get_weights")]
22fn fracdiff_get_weights(diff_amt: f64, size: usize) -> Vec<f64> {
23 openquant::fracdiff::get_weights(diff_amt, size)
24}
25
26/// Fixed-width-window fractional-differencing weights of order `diff_amt`.
27///
28/// Uses the recursion of `get_weights` and stops before the first weight whose absolute
29/// value is below `thresh`, or once `lim` weights exist, whichever comes first (AFML
30/// Snippet 5.3). A `thresh` of 0 or less (or NaN) never satisfies the strict stopping
31/// comparison, even for zero weights: it means "cap only" and yields exactly `lim` weights.
32/// `thresh` is a floor on a single weight's magnitude, not a share of cumulative weight as
33/// in `frac_diff`.
34///
35/// Parameters

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected