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

Function test_cla_efficient_frontier

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

Source from the content-addressed store, hash-verified

119
120#[test]
121fn 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]
139fn test_equal_expected_returns_are_not_perturbed() {

Callers

nothing calls this directly

Calls 2

load_asset_pricesFunction · 0.85
allocateMethod · 0.45

Tested by

no test coverage detected