Abstract
This paper analyzes the numerical stability of Markowitz portfolio optimization model, by identifying and studying a source of instability, that strictly depends on the mathematical structure of the optimization problem and its constraints. As a consequence, it is shown how standard portfolio optimization models can result in an unstable model also when the covariance matrix is well conditioned and the objective function is numerically stable. This depends on the fact that the linear equality constraints of the model very often suffer of almost collinearity and/or bad scaling. A theoretical approach is proposed that exploiting an equivalent formulation of the original optimization problem considerably reduces such structural component of instability. The effectiveness of the proposal is empirically certified through applications on real financial data when numerical optimization approaches are needed to compute the optimal portfolio. Gurobi and MATLAB’s solvers quadprog and fmincon are compared in terms of convergence performances.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Notes
The economic interpretation of the parameters is behind the scope of the paper. The examples are built in order to emphasize the possible numerical issues that can occur in standard settings applications on real financial data.
References
Adam A, Houkari M, Laurent JP (2008) Spectral risk measures and portfolio selection. J Bank Finance 32(9):1870–1882
Best MJ, Grauer RR (1991) On the sensitivity of mean-variance-efficient portfolios to changes in asset means: some analytical and computational results. Rev Financial Studies 4(2):315–342
Bini D, Pan VY (1994) Polynomial and matrix computations. Fundamental algorithms, Progress in theoretical computer Science. Springer, Birkhauser
Brodie J, Daubechies I, De Mol C, Giannone D, Loris I (2009) Sparse and stable Markowitz portfolios. PNAS 106(30):12267–12272
Chang T, Yang S, Chang K (2009) Portfolio optimization problems in different risk measures using genetic algorithm. Expert Syst Appl 36(7):10529–10537
Chen Y, Wiesel A, Hero AO (2011) Robust shrinkage estimation of high-dimensional covariance matrices. IEEE Trans Signal Process 59(9):4097–4107
Choueifaty Y, Coignard Y (2008) Toward Maximum Diversification. J Portf Manag 35(1):40–51
Couillet R, Pascal F, Silverstein JW (2014) Robust estimates of covariance matrices in the large dimensional regime. IEEE Trans Inf Theory 60(11):7269–7278
Constantinides GM, Malliaris AG (1995) Portfolio theory. Handbooks in operations research and management science. Elsevier, Amsterdam, pp 1–30
DeMiguel V, Garlappi L, Nogales FJ, Uppal R (2009) A generalized approach to portfolio optimization: Improving performance by constraining portfolio norms. Manag Sci 55(5):798–812
Fan J, Zhang J, Yu K (2008) Asset allocation and risk assessment with gross exposure constraints for vast portfolios. Available at SSRN: https://ssrn.com/abstract=1307423
Fastrich B, Paterlini S, Winker P (2015) Constructing optimal sparse portfolios using regularization methods. Comput Manag Sci 12(3):417–434
Fastrich B, Winker P (2012) Robust portfolio optimization with a hybrid heuristic algorithm. Comput Manag Sci 9(1):63–88
Frost PA, Savarino JE (1986) An empirical Bayes approach to efficient portfolio selection. J Financial Quant Anal 21(3):293–305
Gotoh J, Takeda A (2011) On the role of norm constraints in portfolio selection. Comput Manag Sci 8(4):323–353
Guigues V (2011) Sensitivity analysis and calibration of the covariance matrix for stable portfolio selection. Comput Optim Appl 48(3):553–579
Golub GH, Van Loan CF (1989) Matrix computations, 2nd edn. The Johns Hopkins University Press, Baltimore-London
Jagannathan R, Ma T (2003) Risk reduction in large portfolios: why imposing the wrong constraints helps. J Finance 54(4):165–1684
Jay E, Soler T, Terreaux E, Ovarlez J-P, Pascal F, De Peretti P, Chorro C (2020) Improving portfolios global performance using a cleaned and robust covariance matrix estimate. Soft Comput 24:8643–8654
Kan R, Smith DR (2008) The distribution of the sample minimum-variance frontier. Manag Sci 54(7):1364–1380
Kan R, Zhou G (2007) Optimal Portfolio Choice with Parameter Uncertainty. J Financial Quant Anal 42(3):621-656
Kim JH, Kim WC, Fabozzi FJ (2018) Recent advancements in robust optimization for investment management. Annals Oper Res 266(1–2):183–198
Kondor I, Pafka S, Nagy G (2007) Noise sensitivity of portfolio selection under various risk measures. J Bank Finance 31(5):1545–1573
Ledoit O, Wolf M (2017) Nonlinear shrinkage of the covariance matrix for portfolio selection: Markowitz meets Goldilocks. Rev Financial Studies 30(12):4349–4388
Li B, Shu Y, Sun Y, Teo KL (2021) An optimistic value-variance-entropy model of uncertain portfolio optimization problem under different risk preferences. Soft Comput 25:3993–4001
Lim AEB, Shanthikumar JG, Vahn G (2011) Conditional value-at-risk in portfolio optimization: coherent but fragile. Oper Res Lett 39(3):163–171
Markowitz H (1952) Portfolio selection. J Finance 7(1):77–91
Rockafellar RT, Uryasev S (2000) Optimization of conditional value-at-risk. J Risk 2:21–41
Scutellà MG, Recchia R (2010) Robust portfolio asset allocation and risk measures. 4OR-Q J Oper Res 8: 113–139
Sortino FA, van der Meer R (1991) Downside risk. J Portf Manag 17(4):27–31
Tu J, Zhou G (2010) Incorporating economic objectives into Bayesian priors: portfolio choice under parameter uncertainty. J Financial Quant Anal 45(4):959–986
Wang B-Y, Xi B-Y (1997) Some inequalities for singular values of matrix products. Linear Algebra Appl 264:109–115
Woerheide W, Persson D (1993) An index of portfolio diversification. Financial Serv Rev 2(2):73–85
Xidonas P, Mavrotas G, Hassapis C, Zopounidis C (2017) Robust multiobjective portfolio optimization: a minimax regret approach. Eur J Oper Res 262(1):299–305
Yang L, Couillet R, McKay MR (2015) A robust statistics approach to minimum variance portfolio optimization. IEEE Trans Signal Process 63(24):6684–6697
Author information
Authors and Affiliations
Contributions
The authors equally contributed to the design and implementation of the research, the analysis of the results and the writing of the manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors have no conflicts of interest to declare that are relevant to the content of this article.
Ethical approval
The paper does not contain any studies with human participants or animals performed by any of the authors.
Additional information
Communicated by Dario Pacciarelli.
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix
Appendix
In this section, the proofs of the main theoretical results stated in the paper are presented.
Let’s start recalling some useful results of linear algebra, whereas classical definitions and well-known concepts will be widely used without giving explicit references; for proofs and more details on the topic, the reader is referred to the textbooks Bini and Pan (1994) and Golub and Van Loan (1989). The first result, Theorem 1, is a technicality on the singular values of a matrix product (see Wang and Xi (1997), Theorem 2). To state it, the following notation is added. Let \(A\in {\mathrm{Mat}}_{n\times m}({\mathbb {R}})\) and \(\sigma _i(A)\) be its ith singular value. In particular, \(\sigma _p(A)=0\) for each positive integer p, with \(p > \mathrm{rank}(A)\).
Theorem 1
(Wang and Xi (1997), Theorem 2) Let \(A\in {\mathrm{Mat}}_n({\mathbb {R}})\) and \(B\in {\mathrm{Mat}}_{n\times m}({\mathbb {R}})\). Let r be a positive real number, k be a positive integer and \(i_1, \ldots , i_k\) be k positive integers such that \(1 \le i_1< \ldots < i_k \le n\). Then,
The notion of square root of an Hermitian positive definite matrix and some of its properties are also recalled as follows.
Definition 2
Let \(A\in {\mathrm{Mat}}_n({\mathbb {R}})\) be an Hermitian positive definite matrix and \(\lambda _1(A), \ldots , \lambda _n(A)\) be the positive eigenvalues of A. The square root of A is the matrix \(\sqrt{A} \in {\mathrm{Mat}}_n({\mathbb {R}})\) defined by:
where \(P \in {\mathrm{Mat}}_n({\mathbb {R}})\) is orthogonal and satisfies
Proposition 5
Let \(A\in {\mathrm{Mat}}_n({\mathbb {R}})\) be an Hermitian positive definite matrix with singular values \(\sigma _1(A), \ldots , \sigma _n(A)\). Let \(\sqrt{A} \in {\mathrm{Mat}}_n({\mathbb {R}})\) be the square root of A. Then, the following properties hold true:
-
1.
\(\sqrt{A} \sqrt{A} = A\);
-
2.
\(\sqrt{A}\) is Hermitian positive definite matrix;
-
3.
\(\sqrt{A^{-1}} = \left( \sqrt{A}\right) ^{-1}\);
-
4.
\(\sqrt{\sigma _1(A)}, \ldots , \sqrt{\sigma _n(A)}\) are the singular values of \(\sqrt{A}\).
In the following proposition, a minimization problem for the condition number of a \(2 \times n\) real matrix, with \(n \ge 2\), is solved.
Proposition 6
Let \(n \ge 2\) and \(v_1, v_2 \in \text {Mat}_{2 \times n}(\mathbb R)\) be two linearly independent row vectors. Let c be a positive real number and \(A_c = \left( \begin{matrix} c v_1 \\ v_2 \end{matrix}\right) \in \text {Mat}_{2 \times n}({\mathbb {R}})\). The minimum value of the condition number of \(A_c\) is attained at \({\overline{c}} = \frac{\Vert v_2\Vert _2}{\Vert v_1\Vert _2}\), that is
Proof
By the hypotheses on \(v_1\), \(v_2\) and the real number \(c>0\), it follows that \(A_c\) has full row rank 2 and that \(A_c A_c^t \in {\mathrm{Mat}}_2({\mathbb {R}})\) is an Hermitian positive definite matrix. Let \(\sigma _1(A_c) \ge \sigma _2(A_c) >0 \) be the singular values of \(A_c\) and \(\lambda _1(c) \ge \lambda _2(c) > 0\) be the eigenvalues of \(A_c A_c^t\). By Definition 1 and well-known properties of the singular values, the condition number of \(A_c\) can be expressed as \(k(A_c) = \frac{\sigma _1(A_c)}{\sigma _2(A_c)} = \frac{\sqrt{\lambda _1(c)}}{\sqrt{\lambda _2(c)}}\), and so the minimization problem can be stated as follows:
The expressions of \(\lambda _1(c)\) and \(\lambda _2(c)\) are explicitly computed through the characteristic polynomial \(p_{A_c}(\lambda )\) of the matrix \(A_c A_c^t \):
The equation \(p_{A_c}(\lambda )=0\) has the real solutions \(\lambda _1(c) \ge \lambda _2(c)>0\):
Note that, in the particular case \(\langle v_1,v_2 \rangle = 0\), the two eigenvalues are \(\lambda _1(c) = c^2 \Vert v_1\Vert _2^2\) and \(\lambda _2(c) = \Vert v_2\Vert _2^2\).
Let \(g: {\mathbb {R}}_{>0} \rightarrow {\mathbb {R}}\) be the real-valued function defined by \(g(c) = \frac{\lambda _1(c)}{\lambda _2(c)}\). Let’s start with the case \(\langle v_1,v_2 \rangle = 0\): It is easy to verify that \(\min _{c>0} g(c)\) is equal to 1 and it is attained at \({{\bar{c}}} = \frac{\Vert v_2\Vert _2}{\Vert v_1\Vert _2}\). In the general case, that is when \(\langle v_1,v_2 \rangle \ne 0\), using (11) and (12), g(c) can be rewritten as follows:
where, obviously, \(h: {\mathbb {R}}_{>0} \rightarrow {\mathbb {R}}\) is the real-valued function defined by
Let’s observe that h(c) can be rewritten as \(h(c)=h_1(h_2(c))\) where \(h_i: {\mathbb {R}}_{>0} \rightarrow {\mathbb {R}}\), \(i=1,2\), are real-valued functions defined as follows:
Obviously, \(h_2\) is a strictly increasing function; further, by some easy computations, the expression of \(h_1'(c)\) is given by:
Since \(|\langle v_1, v_2\rangle | - \Vert v_1\Vert _2\Vert v_2\Vert _2 <0\) (recall that \(v_1, v_2\) are linearly independent by hypothesis), it follows that \(h_1'(c) \ge 0\) for \(c \le \Vert v_2\Vert _2^2\). In particular, \(h_1\) is a strictly increasing function in \((0, \Vert v_2\Vert _2^2)\) with a relative maximum at \({\bar{c}}=\Vert v_2\Vert _2^2\). Now, by composition, it follows that the function h is strictly increasing in \((0, \frac{\Vert v_2\Vert _2}{\Vert v_1\Vert _2})\) with a relative maximum at \({\bar{c}}=\frac{\Vert v_2\Vert _2}{\Vert v_1\Vert _2}\). Finally, using expression (13), it follows that the function g is strictly decreasing in \(\big (0, \frac{\Vert v_2\Vert _2}{\Vert v_1\Vert _2}\big )\) with a relative minimum at \({\bar{c}}=\frac{\Vert v_2\Vert _2}{\Vert v_1\Vert _2}\). Therefore,
so the result follows. \(\square \)
In the following, the proofs of Propositions 1, 2 and 3 are provided.
Proof of Proposition 1
Let \(\sqrt{{\mathbf{V}}^{-1}}\) be the square root of the Hermitian positive definite matrix \({\mathbf{V}}^{-1}\) (see Definition 2). From the expression of \(\mathbf{A}\) and using properties 1., 2. and 3. of Proposition 5, \(\mathbf{A}\) can be rewritten as follows:
where, obviously, \(\mathbf{B} \in \text {Mat}_{n \times 2}({\mathbb {R}})\) is defined by the formula \(\mathbf{B}:=\sqrt{{\mathbf{V}}^{-1}} \left[ \begin{matrix} {\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] \). Note that the matrix \(\mathbf{B}\) has full rank equal to 2 (it follows from the equality \(\text {rank}(\mathbf{B}^t \mathbf{B})=\text {rank}(\mathbf{B})\) and the fact that \(\mathbf{A}\) has full rank). Let \(\sigma _1(\mathbf{A}) \ge \sigma _2(\mathbf{A})>0\) be the singular values of \(\mathbf{A}\) and \(\sigma _1(\mathbf{B}) \ge \sigma _2(\mathbf{B})>0\) be the singular values of \(\mathbf{B}\). Then, it is easy to prove that \(\sigma _i(\mathbf{A}) = \sigma _i^2(\mathbf{B})\), for each \(i=1,2\). An estimate of the singular values of \(\mathbf{B}\) is provided. Firstly, let’s consider \(\sigma _1(\mathbf{B})\); the properties of the singular values yield:
In addition, combining with property 4. of Proposition 5, it follows
In order to give an estimate for \(\sigma _2(\mathbf{B})\), Theorem 1 is applied to the matrix \(\mathbf{B} = \sqrt{{\mathbf{V}}^{-1}} \left[ \begin{matrix} {\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] \), with indices \(i_t=t+1\), for \(t=1,\ldots , n-1\), and \(r=1\):
Combining again with property 4. of Proposition 5, the previous inequality becomes:
Recalling Definition 1, and inequalities (14) and (15), it holds
so the result follows. \(\square \)
Proof of Proposition 2
It is sufficient to show a case in which equality holds in formula (4). To this end, let’s consider the case \({\mathbf{V}}= \delta \mathbf{I}_n \in \text {Mat}_n({\mathbb {R}})\), with \(\delta >0\). Then, the matrix \(\mathbf{A} = \frac{1}{\delta }\left[ \begin{matrix} {\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] ^t \left[ \begin{matrix} {\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] \); using properties of the maximum and minimum singular values, it follows that the condition number of \(\mathbf{A}\) is \(k(\mathbf{A}) = \left( k(\left[ \begin{matrix} {\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] )\right) ^2\). Then, the equality in bound (4) of Proposition 1 follows from the fact that \(k({\mathbf{V}})= k(\delta \mathbf{I}_n) = 1\). \(\square \)
Proof of Proposition 3
Since \({\mathbf{V}}=\delta \mathbf{I}_n\), then the matrix \({{\mathbf{A}}_{\mathbf{c}}} = \frac{1}{\delta c^2}\left[ \begin{matrix} c{\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] ^t \left[ \begin{matrix} c{\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] \) and its condition number is:
Note that, by hypothesis, not all elements of \({\mathbf{R}}\) are equal, so \(c{\mathbf{R}}\) and \({\mathbf{1}}\) are linearly independent vectors for any value of \(c>0\). Applying Proposition 6 to the matrix \(\left[ \begin{matrix} c{\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] ^t\), it follows that \(\min _{c >0} k \left( \left[ \begin{matrix} c{\mathbf{R}}&{\mathbf{1}}\end{matrix}\right] ^t \right) \) is attained at \({{\bar{c}}} = \frac{\Vert {\mathbf{1}}\Vert _2}{\Vert {\mathbf{R}}\Vert _2}\), and so
; therefore, the result follows. \(\square \)
Rights and permissions
About this article
Cite this article
Torrente, ML., Uberti, P. A rescaling technique to improve numerical stability of portfolio optimization problems. Soft Comput 27, 12831–12842 (2023). https://doi.org/10.1007/s00500-021-06543-1
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00500-021-06543-1