Skip to main content

WorstOfAutocallable

Struct WorstOfAutocallable 

Source
pub struct WorstOfAutocallable {
    pub symbol: String,
    pub spots: Vec<f64>,
    pub vols: Vec<f64>,
    pub dividends: Vec<f64>,
    pub correlations: Vec<Vec<f64>>,
    pub payoff: AutocallablePayoff,
    pub maturity_date: NaiveDate,
    pub valuation_date: NaiveDate,
    pub discount_curve: YieldCurve,
    pub mc: MonteCarloConfig,
    /* private fields */
}
Expand description

Autocallable note on the worst-of performance of a correlated basket.

Fields§

§symbol: String§spots: Vec<f64>

Current spots — also the contractual initial fixings that normalize the worst-of performance (the note is assumed priced from inception levels; Greek bumps move the market spot, never the fixing).

§vols: Vec<f64>§dividends: Vec<f64>§correlations: Vec<Vec<f64>>§payoff: AutocallablePayoff

Redemption logic; its barriers are worst-of performance levels in initial_fixing units (e.g. fixing 100, autocall 100 = 100% of initial, protection 70 = 70% of initial).

§maturity_date: NaiveDate§valuation_date: NaiveDate§discount_curve: YieldCurve§mc: MonteCarloConfig

Implementations§

Source§

impl WorstOfAutocallable

Source

pub fn new( symbol: &str, spots: Vec<f64>, vols: Vec<f64>, dividends: Vec<f64>, correlations: Vec<Vec<f64>>, payoff: AutocallablePayoff, maturity_date: NaiveDate, valuation_date: NaiveDate, discount_curve: YieldCurve, mc: MonteCarloConfig, ) -> Result<Self, RustyQLibError>

Validate and construct: dimensions must agree, and a correlation matrix that fails PSD is repaired with Higham’s projection (an asymmetric or non-unit-diagonal matrix is a data error and still rejected).

Source

pub fn time_to_maturity(&self) -> f64

Source

pub fn npv_with_stats(&self) -> McStats

Source

pub fn deltas(&self) -> Vec<f64>

Per-asset spot deltas (central bumps, common random numbers).

Source

pub fn vegas(&self) -> Vec<f64>

Per-asset vegas (central bumps of each asset’s vol).

Source

pub fn theta(&self) -> f64

Source

pub fn rho(&self) -> f64

Trait Implementations§

Source§

impl Instrument for WorstOfAutocallable

Source§

fn try_npv(&self) -> Result<f64, RustyQLibError>

Present value, or a typed error when the instrument cannot be priced (invalid inputs, or an engine/product combination the library refuses to price).
Source§

fn price(&self) -> Result<PricingResult, RustyQLibError>

Price the instrument once, returning value, Greeks and (for Monte Carlo engines) the standard error together in a PricingResult. Read more
Source§

fn npv(&self) -> f64

Present value, panicking on any pricing error. Convenience for instruments already known to be valid; fallible callers (batch pricing, services) should use Instrument::try_npv.

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
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

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

Source§

fn vzip(self) -> V