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

Function prob_mass_function

crates/openquant/src/microstructural_features.rs:546–554  ·  view source on GitHub ↗
(message: &str, word_length: usize)

Source from the content-addressed store, hash-verified

544/// ```
545/// use openquant::microstructural_features::get_bar_based_hasbrouck_lambda;
546///
547/// # fn main() -> Result<(), openquant::util::InputError> {
548/// let lambda = get_bar_based_hasbrouck_lambda(&[100.0, 110.0, 99.0], &[1e4; 3], 2)?;
549/// let expected = (1.1f64.ln() + 0.9f64.ln().abs()) / 100.0 / 2.0;
550/// assert!((lambda[2] - expected).abs() < 1e-15);
551/// # Ok(())
552/// # }
553/// ```
554///
555/// # Errors
556///
557/// [`InputError::LengthMismatch`] if `dollar_volume.len() != close.len()`.

Callers 1

get_plug_in_entropyFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected