Portfolio optimization ====================== Assume that we have one unit of capital and :math:`n` assets to invest on. The :math:`i` th asset has an expected return rate :math:`\xi_i\ge 0`. Our goal is to find a portfolio with the minimal risk such that the expected return is no less than :math:`\lambda`. This problem can be formulated as .. math:: :nowrap: \begin{equation} \begin{array}{l} \min_x ~ \frac{1}{2} x^\top Q x, \\ \text{subject to}~ x\ge0, \sum_{i=1}^m x_i\le 1,\, \sum_{i=1}^m\xi_i x_i\ge \lambda, \end{array} \end{equation} where :math:`Q` is an :math:`n` by :math:`n` risk matrix. We solve the problem with TMAC by using three operator splitting method. Data preparation ----------------- We consume :math:`Q` in matrix market format. You can easily modify the code to deal with other types of matrices. Usage --------- In the bin folder, the executable file :cpp:type:`tmac_3s_portfolio` minimizes the Huber loss:: The usage for ./bin/tmac_3s_portfolio is: -------------------------------------------------------------- ./bin/tmac_3s_portfolio [options] -data -label