(py: Python<'_>, parent: &Bound<'_, PyModule>)
| 143 | tuple_bounds, |
| 144 | ) |
| 145 | .map_err(to_py_err)?; |
| 146 | Ok((out.weights, out.portfolio_risk, out.portfolio_return, out.portfolio_sharpe)) |
| 147 | } |
| 148 | |
| 149 | /// Least-risk portfolio from a price matrix whose expected return is at least a target. |
| 150 | /// |
| 151 | /// Solves `min w' Sigma w` subject to `mu' w >= target_return`, `sum(w) = 1` and the |
| 152 | /// bounds. A target below the minimum-variance portfolio's return yields that portfolio. |
| 153 | /// Returns are simple returns and both `mu` and `Sigma` are annualised with 252 periods a |
| 154 | /// year (daily rows), so `target_return` is an annual figure. Markowitz (1952); AFML |
| 155 | /// chapter 16. |
| 156 | /// |
| 157 | /// Parameters |
| 158 | /// ---------- |
| 159 | /// prices : list[list[float]] |
nothing calls this directly
no outgoing calls
no test coverage detected