Struct ContractualAccretion
pub struct ContractualAccretion {
dates: Vec<NaiveDate>,
factors: Vec<f64>,
taus: Vec<f64>,
rate: f64,
}Expand description
A contractual accretion rule: par face grown by the compounded period
factors ∏(1 + c·τᵢ) over the capitalisation dates elapsed to a date.
Fields§
§dates: Vec<NaiveDate>Capitalisation dates, ascending — the schedule boundaries after the first.
factors: Vec<f64>Growth factor per capitalisation: 1 + rate · τᵢ.
taus: Vec<f64>Accrual year fraction per capitalisation.
rate: f64The annual capitalisation rate.
Implementations§
§impl ContractualAccretion
impl ContractualAccretion
pub fn from_bond(bond: &FixedRateBond) -> Self
pub fn from_bond(bond: &FixedRateBond) -> Self
The rule a bullet’s own schedule and coupon define: each boundary after
the first is a capitalisation at 1 + coupon · τ on the period’s own
accrual basis.
pub fn factor_at(&self, date: NaiveDate) -> f64
pub fn factor_at(&self, date: NaiveDate) -> f64
The accretion factor at date: the product of the growth factors
whose capitalisation date is on or before it. Exactly 1.0 before the
first capitalisation — a bond at issue is at par. Compounded, not
summed: two 5% half-years give 1.05² = 1.050625.
pub fn capitalisations(&self, par_face: f64) -> Vec<Capitalisation>
pub fn capitalisations(&self, par_face: f64) -> Vec<Capitalisation>
Every capitalisation on the bond’s life, in order, growing par_face.
Trait Implementations§
§impl Clone for ContractualAccretion
impl Clone for ContractualAccretion
§fn clone(&self) -> ContractualAccretion
fn clone(&self) -> ContractualAccretion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ContractualAccretion
impl Debug for ContractualAccretion
§impl PartialEq for ContractualAccretion
impl PartialEq for ContractualAccretion
§fn eq(&self, other: &ContractualAccretion) -> bool
fn eq(&self, other: &ContractualAccretion) -> bool
self and other values to be equal, and is used by ==.