pub struct FactorPortfolio {
pub exposures: Vec<(String, f64)>,
}Expand description
Portfolio-level factor exposure: weighted sum of individual asset exposures.
Fields§
§exposures: Vec<(String, f64)>Asset identifiers matching the order of exposures.
Implementations§
Source§impl FactorPortfolio
impl FactorPortfolio
Sourcepub fn new(exposures: Vec<(String, f64)>) -> Self
pub fn new(exposures: Vec<(String, f64)>) -> Self
Creates a new FactorPortfolio from a list of (asset, weight) pairs.
Sourcepub fn aggregate(
&self,
asset_exposures: &[FactorExposure],
) -> Option<FactorExposure>
pub fn aggregate( &self, asset_exposures: &[FactorExposure], ) -> Option<FactorExposure>
Aggregates per-asset FactorExposures into a portfolio-level exposure.
The result’s betas are the weighted sum of individual asset betas.
The result’s alpha is the weighted sum of individual asset alphas.
r_squared and residual_variance are weight-averaged.
Trait Implementations§
Source§impl Clone for FactorPortfolio
impl Clone for FactorPortfolio
Auto Trait Implementations§
impl Freeze for FactorPortfolio
impl RefUnwindSafe for FactorPortfolio
impl Send for FactorPortfolio
impl Sync for FactorPortfolio
impl Unpin for FactorPortfolio
impl UnsafeUnpin for FactorPortfolio
impl UnwindSafe for FactorPortfolio
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