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: StringLabel 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: f64Total portfolio return for the period.
benchmark_return: f64Total benchmark return for the period.
excess_return: f64Excess return: portfolio_return - benchmark_return.
Implementations§
Source§impl AttributionReport
impl AttributionReport
Sourcepub 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>
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.
Sourcepub fn information_ratio(&self, tracking_error: f64) -> Option<f64>
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.