pub struct Shock {
pub factor: RiskFactor,
pub mode: BumpMode,
pub size: f64,
pub underlying: Option<String>,
pub tenors: Option<Vec<f64>>,
pub shifts: Option<Vec<f64>>,
}Expand description
One shock on one factor. The how of each bump lives with the bumped
type (VolSurface::bumped, YieldCurve::bumped); a shock only
names the factor, the sizing and an optional underlying filter.
Fields§
§factor: RiskFactor§mode: BumpMode§size: f64§underlying: Option<String>Restrict a spot/vol shock to one underlying symbol (None / "*"
= every one). Rate and time shocks are market-wide; the filter is
ignored for them.
tenors: Option<Vec<f64>>Key-rate bump tenors in year fractions, strictly increasing —
restricts a rate shock to those parts of the curve (see
RateShift::KeyRateAbsolute). None bumps the whole curve in
parallel. Absolute mode only; rejected on other factors.
shifts: Option<Vec<f64>>Per-tenor sizes for a key-rate shock, same length as tenors;
omitted means size at every tenor.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Shock
impl<'de> Deserialize<'de> for Shock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Shock
impl RefUnwindSafe for Shock
impl Send for Shock
impl Sync for Shock
impl Unpin for Shock
impl UnsafeUnpin for Shock
impl UnwindSafe for Shock
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