MCPcopy Create free account
hub / github.com/Open-Quant/openquant / test_lambda_for_no_bounded_weights

Function test_lambda_for_no_bounded_weights

crates/openquant/tests/cla.rs:139–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137
138#[test]
139fn test_lambda_for_no_bounded_weights() {
140 let prices = load_asset_prices();
141 let mut cla = CLA::new(WeightBounds::Tuple(0.0, 1.0), "mean");
142 cla.allocate(Some(AssetPricesInput::Prices(&prices)), None, None, None, Some("min_volatility"))
143 .unwrap();
144 let cov = covariance(&prices.data);
145 let (x, y) = cla._compute_lambda(&cov, &cov, &cla.expected_returns, None, &[1], &[0]);
146 assert!(x.is_finite());
147 let _ = y as i64;
148}
149
150#[test]
151fn test_free_bound_weights() {

Callers

nothing calls this directly

Calls 4

load_asset_pricesFunction · 0.85
_compute_lambdaMethod · 0.80
covarianceFunction · 0.70
allocateMethod · 0.45

Tested by

no test coverage detected