Crates.io | riskparity |
lib.rs | riskparity |
version | 0.1.0 |
source | src |
created_at | 2023-02-09 05:47:49.413811 |
updated_at | 2023-02-09 05:47:49.413811 |
description | Optimization of risk parity portfolios |
homepage | https://mirca.github.io |
repository | https://github.com/convexfi/riskparity.rs |
max_upload_size | |
id | 780531 |
size | 7,966 |
Implementations of risk parity portfolios in Rust
use riskparity::vanilla::compute_riskparity_ccd_choi;
fn main() {
let cov = ndarray::arr2(&[
[1.0, 0.0015, -0.0119],
[0.0015, 1.0, -0.0308],
[-0.0119, -0.0308, 1.0],
]);
let budget = ndarray::arr1(&[0.1594, 0.0126, 0.8280]);
let maxiter = 100;
let tol = 1e-6;
println!(
"{}",
compute_riskparity_ccd_choi(&cov, &budget, maxiter, tol)
);
// [0.279862, 0.087749, 0.632388]
}