pub struct BenchmarkComparison {
pub benchmark_name: String,
pub benchmark_return: Decimal,
pub alpha: Decimal,
pub beta: Decimal,
pub correlation: Decimal,
pub tracking_error: Decimal,
pub information_ratio: Option<Decimal>,
pub up_capture: Option<Decimal>,
pub down_capture: Option<Decimal>,
}Expand description
Represents the results of comparing a portfolio’s performance against a specified benchmark.
This struct holds various statistical metrics commonly used in finance to evaluate how well a portfolio has performed relative to a market benchmark index.
Fields§
§benchmark_name: StringThe name or identifier of the benchmark used for comparison (e.g., “S&P 500”).
benchmark_return: DecimalThe total return of the benchmark over the evaluated period.
alpha: DecimalAlpha represents the excess return of the portfolio relative to the return of the benchmark, after adjusting for risk (as measured by beta). A positive alpha suggests the portfolio outperformed the benchmark on a risk-adjusted basis.
beta: DecimalBeta measures the volatility or systematic risk of the portfolio in comparison to the benchmark. A beta greater than 1 indicates the portfolio is more volatile than the benchmark, while a beta less than 1 indicates less volatility.
correlation: DecimalCorrelation measures the degree to which the portfolio’s returns move in relation to the benchmark’s returns. A value close to 1 indicates a strong positive relationship, -1 a strong negative relationship, and 0 indicates no linear relationship.
tracking_error: DecimalTracking Error measures the standard deviation of the difference between the portfolio’s returns and the benchmark’s returns. It quantifies how closely the portfolio’s performance follows the benchmark. A lower tracking error indicates the portfolio is closely tracking the benchmark.
information_ratio: Option<Decimal>The Information Ratio measures the portfolio’s risk-adjusted returns relative to the benchmark. It is typically calculated as the portfolio’s alpha divided by its tracking error. A higher information ratio suggests better risk-adjusted performance relative to the benchmark. This is optional as it cannot be calculated if the tracking error is zero.
up_capture: Option<Decimal>Up Capture Ratio measures the portfolio’s performance relative to the benchmark during periods when the benchmark had positive returns. A value greater than 100 suggests the portfolio outperformed the benchmark during up-market periods.
down_capture: Option<Decimal>Down Capture Ratio measures the portfolio’s performance relative to the benchmark during periods when the benchmark had negative returns. A value less than 100 suggests the portfolio lost less than the benchmark during down-market periods.
Trait Implementations§
Source§impl Clone for BenchmarkComparison
impl Clone for BenchmarkComparison
Source§impl Debug for BenchmarkComparison
impl Debug for BenchmarkComparison
Source§impl Default for BenchmarkComparison
impl Default for BenchmarkComparison
Source§impl<'de> Deserialize<'de> for BenchmarkComparison
impl<'de> Deserialize<'de> for BenchmarkComparison
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>,
Auto Trait Implementations§
impl Freeze for BenchmarkComparison
impl RefUnwindSafe for BenchmarkComparison
impl Send for BenchmarkComparison
impl Sync for BenchmarkComparison
impl Unpin for BenchmarkComparison
impl UnsafeUnpin for BenchmarkComparison
impl UnwindSafe for BenchmarkComparison
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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.