pub struct GridSolution<const N: usize> {
pub value: f64,
pub control: ControlOutput<N>,
pub value_grid: Option<Vec<f64>>,
}Expand description
Generic output from a numerical HJB solver, independent of any specific application (market making, option pricing, etc.).
Contains the value function and optimal controls at a query state.
Use GridSolution::to_spreads to convert to market-making spreads
when the model is a market-making model.
Fields§
§value: f64Value function V(t, x) at the query state.
control: ControlOutput<N>Optimal control intensities at the query state.
value_grid: Option<Vec<f64>>Full value function on grid (Some for FD solvers, None for BSDE).
Implementations§
Source§impl<const N: usize> GridSolution<N>
impl<const N: usize> GridSolution<N>
Source§impl<const N: usize> GridSolution<N>
impl<const N: usize> GridSolution<N>
Sourcepub fn to_spreads(&self, a: f64, kappa: f64) -> SpreadResult
pub fn to_spreads(&self, a: f64, kappa: f64) -> SpreadResult
Convert generic solver output to market-making spreads.
Uses the first control dimension (index 0) for bid/ask intensities. This is the convention for all market-making models where state dimension 0 is inventory q.
§Panics
Panics if N = 0 (no control dimensions exist).
Trait Implementations§
Source§impl<const N: usize> Clone for GridSolution<N>
impl<const N: usize> Clone for GridSolution<N>
Source§fn clone(&self) -> GridSolution<N>
fn clone(&self) -> GridSolution<N>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<const N: usize> Freeze for GridSolution<N>
impl<const N: usize> RefUnwindSafe for GridSolution<N>
impl<const N: usize> Send for GridSolution<N>
impl<const N: usize> Sync for GridSolution<N>
impl<const N: usize> Unpin for GridSolution<N>
impl<const N: usize> UnsafeUnpin for GridSolution<N>
impl<const N: usize> UnwindSafe for GridSolution<N>
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 more