Skip to main content

AttributionReport

Struct AttributionReport 

Source
pub struct AttributionReport {
    pub period_label: String,
    pub bhb: Option<BhbResult>,
    pub factor: Option<FactorAttributionResult>,
    pub risk_contributions: Option<Vec<PositionRiskContribution>>,
    pub portfolio_return: f64,
    pub benchmark_return: f64,
    pub excess_return: f64,
}
Expand description

Structured performance attribution report for a single period.

Aggregates the outputs of BrinsonHoodBeebower, FactorAttribution, and RiskContribution into a single report value for serialisation, logging, or display.

Fields§

§period_label: String

Label for this attribution period (e.g., “2024-Q1”).

§bhb: Option<BhbResult>

BHB allocation/selection/interaction decomposition (if computed).

§factor: Option<FactorAttributionResult>

Factor-level return decomposition (if computed).

§risk_contributions: Option<Vec<PositionRiskContribution>>

Per-position risk contributions (if computed).

§portfolio_return: f64

Total portfolio return for the period.

§benchmark_return: f64

Total benchmark return for the period.

§excess_return: f64

Excess return: portfolio_return - benchmark_return.

Implementations§

Source§

impl AttributionReport

Source

pub fn new( period_label: impl Into<String>, portfolio_return: f64, benchmark_return: f64, bhb: Option<BhbResult>, factor: Option<FactorAttributionResult>, risk_contributions: Option<Vec<PositionRiskContribution>>, ) -> Result<Self, FinError>

Construct an attribution report from raw returns and optional attribution results.

§Errors

Returns FinError::InvalidInput if portfolio_return or benchmark_return is non-finite.

Source

pub fn information_ratio(&self, tracking_error: f64) -> Option<f64>

Returns the information ratio proxy: excess_return / tracking_error.

Returns None if tracking_error is zero or non-finite.

Trait Implementations§

Source§

impl Clone for AttributionReport

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AttributionReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.