pub struct SectorAttributionReport {
pub sectors: Vec<SectorAttribution>,
pub total_allocation: f64,
pub total_selection: f64,
pub total_interaction: f64,
pub total_active_return: f64,
pub benchmark_return: f64,
pub portfolio_return: f64,
}Expand description
Aggregate attribution report across all sectors.
Fields§
§sectors: Vec<SectorAttribution>Per-sector decomposition results.
total_allocation: f64Sum of allocation effects across all sectors.
total_selection: f64Sum of selection effects across all sectors.
total_interaction: f64Sum of interaction effects across all sectors.
total_active_return: f64Total active return: total_allocation + total_selection + total_interaction.
benchmark_return: f64Benchmark portfolio return (weighted sum of sector benchmark returns).
portfolio_return: f64Portfolio return (weighted sum of sector portfolio returns).
Implementations§
Source§impl SectorAttributionReport
impl SectorAttributionReport
Sourcepub fn to_table(&self) -> String
pub fn to_table(&self) -> String
Render the attribution report as a plain ASCII table.
Columns: Sector | Port.Wt | Bench.Wt | Port.Ret | Bench.Ret | Alloc | Select | Interact | Active
Sourcepub fn top_contributors(&self, n: usize) -> Vec<&SectorAttribution>
pub fn top_contributors(&self, n: usize) -> Vec<&SectorAttribution>
Return the top n sectors sorted by absolute total active return (descending).
If n exceeds the number of sectors, all sectors are returned.
Trait Implementations§
Source§impl Clone for SectorAttributionReport
impl Clone for SectorAttributionReport
Auto Trait Implementations§
impl Freeze for SectorAttributionReport
impl RefUnwindSafe for SectorAttributionReport
impl Send for SectorAttributionReport
impl Sync for SectorAttributionReport
impl Unpin for SectorAttributionReport
impl UnsafeUnpin for SectorAttributionReport
impl UnwindSafe for SectorAttributionReport
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
Mutably borrows from an owned value. Read more