pub struct RiskMetrics {
pub volatility: Decimal,
pub value_at_risk: Decimal,
pub expected_shortfall: Decimal,
pub coefficient_of_variation: Decimal,
pub sharpe_ratio: Decimal,
}Expand description
Represents a collection of key financial risk metrics used in risk analysis and performance evaluation.
§Overview
The RiskMetrics structure encapsulates a set of quantitative measures
that assess the risk and performance characteristics of a financial portfolio,
asset, or investment strategy. These metrics provide insights into the
variability, potential losses, and overall return of the analyzed entity.
§Applications
The RiskMetrics structure is commonly utilized in:
- Portfolio Management: To assess and balance risk-return trade-offs
- Risk Management: To estimate potential losses and evaluate market exposures
- Performance Analysis: To compare against benchmarks and alternative strategies
- Financial Modeling: To perform stress testing and scenario analysis
§Related Concepts
Metrics: Aggregates risk metrics alongside other statistical measures- Financial Risk Indicators: Additional measures like maximum drawdown, Treynor ratio, and Sortino ratio
§Note
For accuracy, ensure the data used to compute these metrics represents a sufficiently long time horizon and is free from anomalies.
Fields§
§volatility: DecimalMeasures the degree of variation in returns over time. Represents the standard deviation of returns and is a widely used indicator of market risk.
value_at_risk: DecimalQuantifies the maximum expected loss over a defined time horizon with a given confidence level (typically 95% or 99%). Essential for understanding tail-risk and evaluating potential losses.
expected_shortfall: DecimalRepresents the average loss in worst-case scenarios beyond the VaR threshold. Provides a more comprehensive assessment of tail risk than VaR alone.
coefficient_of_variation: DecimalThe coefficient of variation, std_dev / mean: the population
standard deviation of the values (sqrt(sum((x - mean)^2) / n), the
std_dev of BasicMetrics) over their mean, signed as the mean.
It measures dispersion relative to level and is unitless. Curves and
surfaces compute it the same way; it is undefined at a zero mean,
which the computation reports as MetricsError::ZeroMean, and zero
for empty data, like every field here. It replaces beta, which
promised a sensitivity to market returns that no curve or surface has
the data for (#824).
sharpe_ratio: DecimalIndicates the risk-adjusted return by comparing the portfolio’s excess return (return above the risk-free rate) to its volatility. Helps evaluate whether returns justify the associated risk profile.
Trait Implementations§
Source§impl Clone for RiskMetrics
impl Clone for RiskMetrics
Source§impl ComposeSchema for RiskMetrics
impl ComposeSchema for RiskMetrics
impl Copy for RiskMetrics
Source§impl Debug for RiskMetrics
impl Debug for RiskMetrics
Source§impl Display for RiskMetrics
impl Display for RiskMetrics
Source§impl Serialize for RiskMetrics
impl Serialize for RiskMetrics
Auto Trait Implementations§
impl Freeze for RiskMetrics
impl RefUnwindSafe for RiskMetrics
impl Send for RiskMetrics
impl Sync for RiskMetrics
impl Unpin for RiskMetrics
impl UnsafeUnpin for RiskMetrics
impl UnwindSafe for RiskMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.