pub struct Merton {
pub risk_free_rate: f64,
pub mu: f64,
pub sigma: f64,
}Expand description
Merton log-utility portfolio problem.
See the module-level documentation for the formulation and exact solution.
Fields§
§risk_free_rate: f64Risk-free rate.
mu: f64Risky-asset drift.
sigma: f64Risky-asset volatility.
Implementations§
Source§impl Merton
impl Merton
Trait Implementations§
Source§impl ControlProblem<1> for Merton
impl ControlProblem<1> for Merton
Source§type Control = f64
type Control = f64
The action type. For Merton this is a scalar portfolio fraction; for
market making it is a pair of bid/ask intensities.
Source§fn optimize(
&self,
_t: f64,
state: &[f64; 1],
_derivs: &StateDerivatives<1>,
) -> Self::Control
fn optimize( &self, _t: f64, state: &[f64; 1], _derivs: &StateDerivatives<1>, ) -> Self::Control
Returns the control that maximizes the driver at
(t, state).Source§fn running_reward(
&self,
_t: f64,
_state: &[f64; 1],
_control: &Self::Control,
) -> f64
fn running_reward( &self, _t: f64, _state: &[f64; 1], _control: &Self::Control, ) -> f64
Returns the running reward
f(t,x,u).Source§fn generator(
&self,
_t: f64,
state: &[f64; 1],
control: &Self::Control,
derivs: &StateDerivatives<1>,
) -> f64
fn generator( &self, _t: f64, state: &[f64; 1], control: &Self::Control, derivs: &StateDerivatives<1>, ) -> f64
Returns the infinitesimal generator
L^u V for the given control and
derivative bundle.Source§fn next_step(
&self,
_t: f64,
state: &[f64; 1],
dt: f64,
noise: &[f64; 1],
) -> [f64; 1]
fn next_step( &self, _t: f64, state: &[f64; 1], dt: f64, noise: &[f64; 1], ) -> [f64; 1]
Advances the state one step under the optimal control at forward time
t.Source§fn is_diffusion_dimension(&self, _dim: usize) -> bool
fn is_diffusion_dimension(&self, _dim: usize) -> bool
Whether a dimension is driven by Brownian diffusion.
Source§fn driver(
&self,
t: f64,
state: &[f64; N],
control: &Self::Control,
derivs: &StateDerivatives<N>,
) -> f64
fn driver( &self, t: f64, state: &[f64; N], control: &Self::Control, derivs: &StateDerivatives<N>, ) -> f64
Returns the full HJB driver
f(t,x,u) + L^u V. Read moreSource§fn bsde_driver(
&self,
t: f64,
state: &[f64; N],
control: &Self::Control,
_derivs: &StateDerivatives<N>,
_dt: f64,
) -> f64
fn bsde_driver( &self, t: f64, state: &[f64; N], control: &Self::Control, _derivs: &StateDerivatives<N>, _dt: f64, ) -> f64
Returns the backward driver consumed by the BSDE regression solver. Read more
Source§fn apply_constraint(&self, _state: &[f64; N], value: f64) -> f64
fn apply_constraint(&self, _state: &[f64; N], value: f64) -> f64
Optional pointwise constraint on the value, e.g. the early-exercise
obstacle
V >= payoff for an American option. Read moreSource§fn constant_discount_rate(&self) -> Option<f64>
fn constant_discount_rate(&self) -> Option<f64>
Constant discount rate hint. Defaults to
None (state dependent).Source§fn next_step_controlled(
&self,
t: f64,
state: &[f64; N],
_control: &Self::Control,
dt: f64,
noise: &[f64; N],
) -> [f64; N]
fn next_step_controlled( &self, t: f64, state: &[f64; N], _control: &Self::Control, dt: f64, noise: &[f64; N], ) -> [f64; N]
Advances the state one step under an explicitly supplied control. Read more
Source§fn is_reduced_value(&self) -> bool
fn is_reduced_value(&self) -> bool
Whether the value this problem solves is a reduced value. Read more
Source§fn gradient_step(&self, _dim: usize) -> f64
fn gradient_step(&self, _dim: usize) -> f64
Physical finite-difference step for a dimension, used by mesh-free
gradient stencils.
impl Copy for Merton
Source§impl From<&MertonJump> for Merton
The no-jump reduction of MertonJump with jump_rate = 0.
impl From<&MertonJump> for Merton
The no-jump reduction of MertonJump with jump_rate = 0.
Source§fn from(model: &MertonJump) -> Self
fn from(model: &MertonJump) -> Self
Converts to this type from the input type.
Source§impl PdeProblem<1> for Merton
impl PdeProblem<1> for Merton
Source§fn dimension_kind(&self, _dim: usize) -> DimensionKind
fn dimension_kind(&self, _dim: usize) -> DimensionKind
Discretization kind for
dim. Read moreSource§fn transport(
&self,
_t: f64,
state: &[f64; 1],
control: &Self::Control,
_derivs: &StateDerivatives<1>,
) -> Transport<1>
fn transport( &self, _t: f64, state: &[f64; 1], control: &Self::Control, _derivs: &StateDerivatives<1>, ) -> Transport<1>
Transport and local source for the given control and derivatives. Read more
Source§fn jump_kernel(
&self,
_t: f64,
_state: &[f64; N],
_control: &Self::Control,
_derivs: &StateDerivatives<N>,
transport: &Transport<N>,
) -> JumpKernel<N>
fn jump_kernel( &self, _t: f64, _state: &[f64; N], _control: &Self::Control, _derivs: &StateDerivatives<N>, transport: &Transport<N>, ) -> JumpKernel<N>
Jump kernel for arbitrary-amplitude jump dimensions. Read more
Auto Trait Implementations§
impl Freeze for Merton
impl RefUnwindSafe for Merton
impl Send for Merton
impl Sync for Merton
impl Unpin for Merton
impl UnsafeUnpin for Merton
impl UnwindSafe for Merton
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