From 92b22a70ed368c93dd43a74e960b396174e1b196 Mon Sep 17 00:00:00 2001 From: Daniel Boros Date: Sat, 28 Sep 2024 20:37:58 +0200 Subject: [PATCH] fix: heston nmle --- stochastic-rs-quant/Cargo.toml | 2 +- stochastic-rs-quant/src/yahoo.rs | 2 +- stochastic-rs-stats/src/fd.rs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/stochastic-rs-quant/Cargo.toml b/stochastic-rs-quant/Cargo.toml index 14b027b..f126ce9 100644 --- a/stochastic-rs-quant/Cargo.toml +++ b/stochastic-rs-quant/Cargo.toml @@ -24,7 +24,7 @@ yahoo_finance_api = "2.2.1" mimalloc = ["dep:mimalloc"] jemalloc = ["dep:tikv-jemallocator"] yahoo = [] -default = [] +default = ["yahoo"] [lib] name = "stochastic_rs_quant" diff --git a/stochastic-rs-quant/src/yahoo.rs b/stochastic-rs-quant/src/yahoo.rs index 67aff15..357ba57 100644 --- a/stochastic-rs-quant/src/yahoo.rs +++ b/stochastic-rs-quant/src/yahoo.rs @@ -57,7 +57,7 @@ impl<'a> Default for Yahoo<'a> { impl<'a> Yahoo<'a> { /// Set symbol pub fn set_symbol(&mut self, symbol: &'a str) { - self.symbol = Some(Cow::Borrowed(&symbol)); + self.symbol = Some(Cow::Borrowed(symbol)); } /// Set start date diff --git a/stochastic-rs-stats/src/fd.rs b/stochastic-rs-stats/src/fd.rs index 4f2cada..2def59c 100644 --- a/stochastic-rs-stats/src/fd.rs +++ b/stochastic-rs-stats/src/fd.rs @@ -33,9 +33,7 @@ impl FractalDim { let v1 = vp(sum1, 1, self.x.len()); let v2 = vp(sum2, 2, self.x.len()); - let d_vp = 2.0 - (1.0 / p) * ((v2.ln() - v1.ln()) / LN_2); - - d_vp + 2.0 - (1.0 / p) * ((v2.ln() - v1.ln()) / LN_2) } pub fn higuchi_fd(&self, kmax: usize) -> f64 {