pub struct RangeAccrualNote {
pub principal: f64,
pub spot: f64,
pub lower_barrier: f64,
pub upper_barrier: f64,
pub accrual_rate: f64,
pub maturity: f64,
pub rate: f64,
pub volatility: f64,
pub n_observations: usize,
}Expand description
Range accrual note - accrues interest when underlying stays in range
Fields§
§principal: f64Principal amount
spot: f64Underlying spot price
lower_barrier: f64Lower barrier
upper_barrier: f64Upper barrier
accrual_rate: f64Accrual rate per day (annualized)
maturity: f64Time to maturity
rate: f64Risk-free rate
volatility: f64Volatility
n_observations: usizeNumber of observation days
Implementations§
Source§impl RangeAccrualNote
impl RangeAccrualNote
Sourcepub fn new(
principal: f64,
spot: f64,
lower_barrier: f64,
upper_barrier: f64,
accrual_rate: f64,
maturity: f64,
rate: f64,
volatility: f64,
n_observations: usize,
) -> IntegrateResult<Self>
pub fn new( principal: f64, spot: f64, lower_barrier: f64, upper_barrier: f64, accrual_rate: f64, maturity: f64, rate: f64, volatility: f64, n_observations: usize, ) -> IntegrateResult<Self>
Create a new range accrual note
Sourcepub fn price_monte_carlo(&self, n_paths: usize) -> IntegrateResult<f64>
pub fn price_monte_carlo(&self, n_paths: usize) -> IntegrateResult<f64>
Price range accrual note using Monte Carlo
Trait Implementations§
Source§impl Clone for RangeAccrualNote
impl Clone for RangeAccrualNote
Source§fn clone(&self) -> RangeAccrualNote
fn clone(&self) -> RangeAccrualNote
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for RangeAccrualNote
impl RefUnwindSafe for RangeAccrualNote
impl Send for RangeAccrualNote
impl Sync for RangeAccrualNote
impl Unpin for RangeAccrualNote
impl UnwindSafe for RangeAccrualNote
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
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