Enum Scale
#[non_exhaustive]pub enum Scale {
Unit,
Bp,
Percent,
VolPoint,
Custom(Factor),
}Expand description
The unit a reading is reported in: the per-unit-quote derivative, multiplied by a factor.
A risk pass produces ∂V/∂q per unit of the quote. A desk reads it per
basis point, per vol point, per recovery point — which is the same number
times a constant, and a constant the caller should name rather than apply.
Linear, so a par ladder read at any scale still sums to its par total read at
that scale.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unit
Per unit of the quote: the derivative as the pass produced it.
Bp
Per basis point: × 1e-4.
Percent
Per point of a quote read in percent — a recovery or a correlation
point: × 1e-2.
VolPoint
Per vol point of a lognormal vol: × 1e-2.
Custom(Factor)
Per any other stated multiple of the quote.
Implementations§
§impl Scale
impl Scale
pub fn custom(value: f64) -> Option<Self>
pub fn custom(value: f64) -> Option<Self>
A custom scale of value, or None where Factor::new refuses it.
fn parse_custom(s: &str) -> Option<Self>
fn parse_custom(s: &str) -> Option<Self>
x<factor>, the open tail of the vocabulary.
Trait Implementations§
impl Copy for Scale
§impl Display for Scale
The canonical spelling: a listed name, or x and the shortest decimal that
parses back to the factor’s bits.
impl Display for Scale
The canonical spelling: a listed name, or x and the shortest decimal that
parses back to the factor’s bits.