pub enum WalkType {
Brownian {
dt: Positive,
drift: Decimal,
volatility: Positive,
},
GeometricBrownian {
dt: Positive,
drift: Decimal,
volatility: Positive,
},
LogReturns {
dt: Positive,
expected_return: Decimal,
volatility: Positive,
autocorrelation: Option<Decimal>,
},
MeanReverting {
dt: Positive,
volatility: Positive,
speed: Positive,
mean: Positive,
},
JumpDiffusion {
dt: Positive,
drift: Decimal,
volatility: Positive,
intensity: Positive,
jump_mean: Decimal,
jump_volatility: Positive,
},
Garch {
dt: Positive,
drift: Decimal,
volatility: Positive,
alpha: Positive,
beta: Positive,
},
Heston {
dt: Positive,
drift: Decimal,
volatility: Positive,
kappa: Positive,
theta: Positive,
xi: Positive,
rho: Decimal,
},
Custom {
dt: Positive,
drift: Decimal,
volatility: Positive,
vov: Positive,
vol_speed: Positive,
vol_mean: Positive,
},
Telegraph {
dt: Positive,
drift: Decimal,
volatility: Positive,
lambda_up: Positive,
lambda_down: Positive,
vol_multiplier_up: Option<Positive>,
vol_multiplier_down: Option<Positive>,
},
Historical {
timeframe: TimeFrame,
prices: Vec<Positive>,
symbol: Option<String>,
},
}Expand description
Enum defining different types of random walks
Variants§
Brownian
Standard Brownian motion (normal increments)
Fields
GeometricBrownian
Geometric Brownian motion (log-normal increments)
Fields
LogReturns
Log-Returns model (simulates directly log-returns instead of prices)
Fields
MeanReverting
Mean-reverting process (Ornstein-Uhlenbeck)
Fields
JumpDiffusion
Jump diffusion process (normal increments with occasional jumps)
Fields
Garch
GARCH process (time-varying volatility)
Fields
Heston
Heston model (stochastic volatility)
Fields
Custom
Custom process defined by a function
Fields
Telegraph
Telegraph process (two-state regime switching model)
Fields
Historical
Represents historical price data for a given timeframe.
This encapsulates the historical price data, including the timeframe over which the data was collected and a vector of positive price values. It is typically used to store and process historical market data for financial analysis and simulation purposes.
§Fields
timeframe: TheTimeFrameover which the historical data is relevant.prices: AVecofPositivevalues representing the historical prices.
Fields
symbol: Option<String>A field representing an optional symbol.
This field stores an optional String that can represent a symbol.
It can hold a Some(String) value if a symbol is provided, or None if no symbol is specified.
§Use Case
This field can be utilized in scenarios where a symbol (e.g., stock ticker, identifier) may or may not be required.
Implementations§
Source§impl WalkType
impl WalkType
Sourcepub fn volatility(&self) -> Option<Positive>
pub fn volatility(&self) -> Option<Positive>
Returns the volatility parameter carried by this walk type.
For the nine synthetic walk types this is the annualized volatility
field of the variant (the initial volatility for stochastic-volatility
models such as Garch, Heston, Custom and Telegraph).
Returns None for WalkType::Historical, whose volatility is not a
parameter but must be estimated from the provided price history.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WalkType
impl<'de> Deserialize<'de> for WalkType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for WalkType
Auto Trait Implementations§
impl Freeze for WalkType
impl RefUnwindSafe for WalkType
impl Send for WalkType
impl Sync for WalkType
impl Unpin for WalkType
impl UnsafeUnpin for WalkType
impl UnwindSafe for WalkType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.