Premium problem168. Global Minimum-Variance Portfolio Weights

Medium Locked

Given a covariance matrix cov, return the weight vector minimising w' @ cov @ w subject to sum(w) == 1:

  • that is inv(cov) @ 1 / (1' @ inv(cov) @ 1)
  • compute it with a linear solve, not an explicit inverse

Input

[[0.04 0.01]
 [0.01 0.09]]

Output

[0.72727273 0.27272727]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)