Skip to main content

allocate_efficient_risk

Function allocate_efficient_risk 

Source
pub fn allocate_efficient_risk(
    prices: &DMatrix<f64>,
    target_return: f64,
    bounds: Option<HashMap<usize, (f64, f64)>>,
    tuple_bounds: Option<(f64, f64)>,
) -> Result<MeanVariance, AllocError>
Expand description

Least-risk portfolio from prices whose expected return is at least target_return (an annual figure). A target below the minimum-variance portfolio’s return yields the minimum-variance portfolio.

bounds / tuple_bounds are as in AllocationOptions; other options take their defaults. See allocate_with_solution for the price conventions.

§Errors

As allocate_with_solution with "efficient_risk"; an unreachable target is reported as AllocError::OptimizationFailed.