Skip to main content

AmericanPut

Struct AmericanPut 

Source
pub struct AmericanPut {
    pub risk_free_rate: f64,
    pub volatility: f64,
    pub strike: f64,
    pub dx: f64,
}
Expand description

American Put Option

Models the optimal exercise strategy for an American Put option. This is formulated as an optimal stopping problem, but can be solved via HJB by treating the exercise decision as a control.

Dynamics follow Geometric Brownian Motion for the underlying asset.

Fields§

§risk_free_rate: f64

Risk-free interest rate (r).

§volatility: f64

Volatility of the underlying asset ($\sigma$).

§strike: f64

Strike price (K).

§dx: f64

Spatial discretization step size (dx) used for finite difference coefficients.

Implementations§

Source§

impl AmericanPut

Source

pub fn new(risk_free_rate: f64, volatility: f64, strike: f64, dx: f64) -> Self

Source

pub fn set_dx(&mut self, dx: f64)

Trait Implementations§

Source§

impl Model<1> for AmericanPut

Source§

type Process = ()

The underlying stochastic process driving the continuous state dimensions. Set to () for models without a corresponding market_model process.
Source§

fn process(&self)

Returns the underlying stochastic process, if any.
Source§

fn optimize(&self, state: &[f64; 1], _grads: &Gradients<1>) -> ControlOutput<1>

Given the current state and value function gradients ($\nabla V$), computations the optimal controls. Read more
Source§

fn terminal(&self, state: &[f64; 1]) -> f64

Computes the terminal value function $V(T, x)$ (Final Condition). Usually represents liquidation cost or final utility of wealth.
Source§

fn discount_rate(&self, _state: &[f64; 1]) -> f64

Optional discount rate at the given state. Default implementation returns 0.0.
Source§

fn constant_discount_rate(&self) -> Option<f64>

Optimization hint: Returns Some(r) if the discount rate is constant across all states. Returns None if it depends on state. Default implementation returns None (safe fallback).
Source§

fn apply_constraint(&self, state: &[f64; 1], value: f64) -> f64

Optional constraint application (e.g. for American options) Default implementation does nothing.
Source§

fn fill_rate_base(&self, _state: &[f64; N]) -> f64

Base order arrival rate $A$ used for intensity-to-spread conversion. May depend on the current state (e.g. Hawkes lambda). Defaults to 1.0.
Source§

fn fill_rate_decay(&self) -> f64

Order fill decay parameter $\kappa$ used for intensity-to-spread conversion. Defaults to 1.0 for non-market-making models. Override in market-making models.
Source§

fn next_step( &self, current_state: &[f64; N], dt: f64, noise: &[f64; N], ) -> [f64; N]

Simulates the next state for BSDE exploration. Default implementation is a simple random walk: x’ = x + sqrt(dt) * noise
Source§

fn next_step_controlled( &self, current_state: &[f64; N], _control: &ControlOutput<N>, dt: f64, noise: &[f64; N], ) -> [f64; N]

Simulates the next state for Coupled FBSDE exploration where dynamics depend on control. Default implementation falls back to next_step (Decoupled).
Source§

fn is_diffusion_dimension(&self, _dim: usize) -> bool

Indicates if a dimension is driven by Brownian diffusion. If true, the BSDE backward step will skip the lambda_plus/minus drift term for this dimension (it is already handled by the forward simulation noise).
Source§

fn is_integer_dimension(&self, _dim: usize) -> bool

Indicates if a dimension takes only integer values (e.g. inventory q). Controls BSDE initialization: integer dimensions are sampled discretely while continuous dimensions (even if non-diffusion) are sampled with uniform noise. Default: false (continuous).
Source§

fn transform_noise(&self, _state: &[f64; N], noise: &[f64; N]) -> [f64; N]

Optional transform for standard normal samples before forward stepping. Read more
Source§

fn gradient_step(&self, _dim: usize) -> f64

Physical finite-difference step for each state dimension used by BSDE gradient stencils. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V