()
| 119 | |
| 120 | #[test] |
| 121 | fn test_cla_efficient_frontier() { |
| 122 | let prices = load_asset_prices(); |
| 123 | let mut cla = CLA::new(WeightBounds::Tuple(0.0, 1.0), "mean"); |
| 124 | cla.allocate( |
| 125 | Some(AssetPricesInput::Prices(&prices)), |
| 126 | None, |
| 127 | None, |
| 128 | None, |
| 129 | Some("efficient_frontier"), |
| 130 | ) |
| 131 | .unwrap(); |
| 132 | assert_eq!(cla.efficient_frontier_means.len(), cla.efficient_frontier_sigma.len()); |
| 133 | assert_eq!(cla.efficient_frontier_sigma.len(), cla.weights.len()); |
| 134 | assert!(cla.efficient_frontier_sigma.last().unwrap() <= &cla.efficient_frontier_sigma[0]); |
| 135 | assert!(cla.efficient_frontier_means.last().unwrap() <= &cla.efficient_frontier_means[0]); |
| 136 | } |
| 137 | |
| 138 | #[test] |
| 139 | fn test_equal_expected_returns_are_not_perturbed() { |
nothing calls this directly
no test coverage detected