pub struct MertonJumpLogNormal {
pub risk_free_rate: f64,
pub mu: f64,
pub sigma: f64,
pub jump_rate: f64,
pub jump_mean: f64,
pub jump_vol: f64,
}Expand description
Merton log-utility portfolio with log-normal jumps.
See the module-level documentation for the formulation and numerical solution.
Fields§
§risk_free_rate: f64Risk-free rate.
mu: f64Risky-asset drift.
sigma: f64Risky-asset volatility.
jump_rate: f64Poisson jump intensity.
jump_mean: f64Mean of the log jump size, E[ln Y].
jump_vol: f64Volatility of the log jump size, std(ln Y).
Implementations§
Source§impl MertonJumpLogNormal
impl MertonJumpLogNormal
Sourcepub fn new(
risk_free_rate: f64,
mu: f64,
sigma: f64,
jump_rate: f64,
jump_mean: f64,
jump_vol: f64,
) -> Self
pub fn new( risk_free_rate: f64, mu: f64, sigma: f64, jump_rate: f64, jump_mean: f64, jump_vol: f64, ) -> Self
Creates a Merton log-normal jump problem.
§Panics
Panics if sigma or jump_vol is negative, if jump_rate is negative,
or if the first-order condition does not bracket an interior optimum on
[0, 1] (i.e. the chosen parameters drive the policy to a corner).
§Examples
use solver::models::merton_jump_lognormal::MertonJumpLogNormal;
let m = MertonJumpLogNormal::new(0.03, 0.08, 0.3, 1.0, -0.02, 0.05);
assert!(m.jump_vol >= 0.0);Sourcepub fn exact_policy(&self) -> f64
pub fn exact_policy(&self) -> f64
Optimal portfolio fraction, bracketed on [0, 1] and refined by
bisection.
§Examples
use solver::models::merton_jump_lognormal::MertonJumpLogNormal;
let m = MertonJumpLogNormal::new(0.03, 0.08, 0.3, 1.0, -0.02, 0.05);
assert!(m.exact_policy() > 0.0 && m.exact_policy() < 1.0);Sourcepub fn exact_value(&self, wealth: f64, tau: f64) -> f64
pub fn exact_value(&self, wealth: f64, tau: f64) -> f64
Closed-form value function V(t, x) for remaining horizon tau = T - t.
§Examples
use solver::models::merton_jump_lognormal::MertonJumpLogNormal;
let m = MertonJumpLogNormal::new(0.03, 0.08, 0.3, 1.0, -0.02, 0.05);
let v = m.exact_value(100.0, 1.0);
assert!(v.is_finite());Trait Implementations§
Source§impl Clone for MertonJumpLogNormal
impl Clone for MertonJumpLogNormal
Source§fn clone(&self) -> MertonJumpLogNormal
fn clone(&self) -> MertonJumpLogNormal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MertonJumpLogNormal
Source§impl Debug for MertonJumpLogNormal
impl Debug for MertonJumpLogNormal
Source§impl From<&MertonJumpLogNormal> for MertonJump
The zero-volatility reduction of MertonJumpLogNormal to the
deterministic-jump MertonJump with multiplier y = e^m.
impl From<&MertonJumpLogNormal> for MertonJump
The zero-volatility reduction of MertonJumpLogNormal to the
deterministic-jump MertonJump with multiplier y = e^m.
Source§fn from(model: &MertonJumpLogNormal) -> Self
fn from(model: &MertonJumpLogNormal) -> Self
Auto Trait Implementations§
impl Freeze for MertonJumpLogNormal
impl RefUnwindSafe for MertonJumpLogNormal
impl Send for MertonJumpLogNormal
impl Sync for MertonJumpLogNormal
impl Unpin for MertonJumpLogNormal
impl UnsafeUnpin for MertonJumpLogNormal
impl UnwindSafe for MertonJumpLogNormal
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
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> ⓘ
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 more