()
| 176 | |
| 177 | #[test] |
| 178 | fn test_lambda_for_zero_matrices() { |
| 179 | let prices = load_asset_prices(); |
| 180 | let mut cla = CLA::new(WeightBounds::Tuple(0.0, 1.0), "mean"); |
| 181 | cla.allocate(Some(AssetPricesInput::Prices(&prices)), None, None, None, Some("min_volatility")) |
| 182 | .unwrap(); |
| 183 | let mut cov = covariance(&prices.data); |
| 184 | for v in cov.iter_mut() { |
| 185 | *v = 0.0; |
| 186 | } |
| 187 | let (x, y) = cla._compute_lambda(&cov, &cov, &cla.expected_returns, None, &[1], &[0]); |
| 188 | assert_eq!(x, 0.0); |
| 189 | assert_eq!(y, 0); |
| 190 | } |
| 191 | |
| 192 | #[test] |
| 193 | fn test_w_for_no_bounded_weights() { |
nothing calls this directly
no test coverage detected