Solving real-life portfolio problem using stochastic programming and Monte-Carlo techniques 1 Introduction Martin Branda 1 Abstract. We deal with real-life portfolio problem with Value at Risk, transaction costs and integer allocations where the random returns are modeled using the multivariate skewed t-distribution. The original problem can be formulated as a stochastic programming problem with one chance constraint which is very hard to solve exactly. It is necessary to use sampling techniques to represent the randomness by equiprobable scenarios and to solve the approximated portfolio problem by standard mixed-integer solvers. In [5, 6, 8], it was shown that the chance constrained problems can be reformulated using penalty functions. However, to solve the problem with penalty objectives, it is also necessary to use sampling techniques. Finally, the ability to generate a feasible solution of the original chance constrained problem using the sample approximations of the chance constraints directly or via sample approximation of the penalty function objective is compared. Keywords: Value at Risk, stochastic programming, Monte-Carlo simulation, chance constraints, penalty functions. JEL classification: C44 AMS classification: 90C15 In this paper, we address a financial optimization problem with Value at Risk constraint, transaction costs and integer allocations. The original problem can be formulated using one chance constraint where the random returns are modeled using the multivariate skewed t-distribution. Solving the chance constrained problems may be very hard in general, cf. [1, 11], because the feasible region is not convex even if the functions are convex and in many cases it is even not easy to check feasibility because it leads to computations of multivariate integrals. In the case that the underlying distribution is continuous or discrete with many realizations, the sample approximation techniques and mixed-integer programming reformulation can help us to solve the problem approximately, see [1, 10]. Another possible formulation of stochastic programming problems can be based on penalty functions. The approach for solving nonlinear deterministic programs with several constraints using the penalty functions is well studied in literature, cf. [4]. In stochastic programming, the penalty functions help us to penalize the infeasibilities with respect to the realizations of a random vector. The obtained problems with penalties and with a fixed set of feasible solutions are simpler to solve and analyze then the chance constrained programs. In [8], a rigorous proof of the relationship between the optimal values of the problems for a special additive penalty function and one chance constraint was given. The authors showed that the model with chance constraints and the penalty type model are asymptotically equivalent under quite mild assumptions. The approach was recently extended to a whole class of penalty functions in [6]. In [5], we proposed further extension to multiple jointly chance constrained problems which cover the joint as well as the separate chance constrained problems as special cases. The reformulation of chance constrained problems using penalties was applied in insurance and water-management, cf. [7, 8]. We discuss solving both formulations using Monte-Carlo simulation techniques. We will show that the penalty function approach can be helpful in numerical solution of stochastic optimization problems with chance constraints. We compare the ability to generate a feasible solution of the original chance constrained problem using the sample approximations of the chance constraint directly or via sample 1 Charles University in Prague/Faculty of Mathematics and Physics, Department of Probability and Mathematical Statistics, Sokolovska 83, Prague 8, 186 75, Czech Republic, e-mail: branda@karlin.mff.cuni.cz 1
1. 2. 3. Stochastic Sample Solution programming approximation validation formulation (SA) Program Chance constrained SA CCP Reliability with a random problem (CCP) factor Penalty function SA PFP Reliability problem (PFP) Table 1: Formulation and approximation schema approximation of the penalty function objective. After solving the sample approximated problems some post-analysis of obtained solutions is necessary. In our case, validation of solutions on some independent sample is possible and helps us to estimate how reliable our solutions are. The formulation and approximation schema is visualized in Table 1. The paper is organized as follows. In section 2, the financial optimization problem with Value at Risk constraint, transaction costs and integer allocations is formulated as a chance constrained problem. Then, the formulation using the penalty function is introduced. In section 3, the randomness is approximated using Monte-Carlo techniques and the sample approximated problems are proposed. Finally, in section 4 the results of solving the problems are summarized and comparison is made. 2 Mixed-integer VaR and penalty function problems In this section, we introduce the optimization problem with Value at Risk constraint, transaction costs and integer allocations, which is appropriate for a small investor. Moreover, we propose other possible formulation using a penalty function. We denote Q i the quotation of a security i, f i the fixed transaction costs (not depending on the investment amount), c i the proportional transaction costs (depending on the investment amount), R i the random return of the security i, x i the number of security i, y i binary variables which indicate, whether the security i is bought or not. Then, the random loss function depending on our decisions and on the random returns has the following form (R i c i )Q i x i + f i y i. The set of feasible solutions contains a budget constraint and the restrictions on the minimal and the maximal number of securities which can be bought, i.e. X = {(x, y) N n {0, 1} n B l n (1 + c i)q i x i + n f iy i B u, l i y i x i u i y i, i = 1,..., n}, where B l and B u are the lower and the upper bound on the capital available for the portfolio investment, l i 0 and u i > 0 are the lower and the upper number of units for each security i. The chance constrained portfolio problem can be formulated as follows ψ ε = min (r,x,y) R X r P ( (R i c i )Q i x i + ) f i y i r 1 ε, (1) where P is a known distribution of the random returns. The problem (1) is, in fact, minimization of Value at Risk (VaR).
Consider the penalty function ϑ : R m R +, which is continuous nondecreasing, equal to 0 on R and positive otherwise, e.g. ϑ p (u) = ( [u] +) p, u R, for some p N. Corresponding problem using the penalty function can be formulated as [ ( min r + N E ϑ (R i c i )Q i x i + f i y i r) ], (2) (r,x,y) R X where the penalty parameter N goes theoretically to and penalizes possible violations of the constraint. For particular penalty function ϑ 1 = [u] + we obtain ϕ N = min r + N E (r,x,y) R X [ (R i c i )Q i x i + + f i y i r]. (3) Setting N = 1/(1 ε) we minimize Conditional Value at Risk (CVaR) exactly, cf. the minimization formula in [12]. Similar problem with CVaR and transaction costs was considered by [2]. CVaR is also closely related to the second order stochastic dominance (SSD), see [9]. 3 Sample approximated problems To solve the chance constrained problem for general multivariate continuous distribution of the random returns, e.g. multivariate skewed t-distribution, we have to face some problems: the set of feasible solutions given by chance constraint is nonconvex and it is even difficult to check feasibility of a point. However, it is possible to use Monte-Carlo techniques to sample finite number of equiprobable realizations of the distribution and then to solve the corresponding approximated problem using deterministic reformulation. However, the obtained solution of the approximated problem can be hardly considered as the optimal solution of the original problem. If the sample size is large enough, we hopefully obtain a feasible solution of the original problems. Let R s = (R s 1,..., R s n) be an independent Monte-Carlo sample of the underlying multivariate distribution. The sample approximation of the integrated chance constrained portfolio problem (1) can be formulated as follows ˆψ S ε = min (r,x,y) R X r 1 S S ( I (Ri s c i )Q i x i + ) f i y i r 1 ε, (4) where I( ) denotes the indicator function which is equal to 1 if the condition in the brackets is fulfilled, and 0 otherwise. However, to solve the approximated VaR problem, we have to consider additional binary variables z s, s = 1,..., S, which number is equal to the sample size. The problem can be than formulated as a large mixed-integer linear problem ˆψ S ε = min (r,x,y,z) R X {0,1} S r 1 S (Ri s c i )Q i x i + S z s 1 ε, f i y i M(1 z s ) r, (5) where M is a constant large enough. It is also possible to estimate sample size which is necessary to obtain a solution which is feasible with a high probability for the original chance constrained problem, see [1, 10]. As we showed in the previous section, another possibility how to solve the chance constrained problem is to use a penalty function and incorporate it into the objective function, see the program (2).
AAA CETV CEZ ECM ERST KB NWR ORCO PGSN PMCR O2 UNPE VIGR 41370 35287 34680 28910 65550 89275 17050 8550 63450 145650 42510 40650 61677 Table 2: Prices of minilots (CZK) However, the resulting problem is also necessary to solve using the Monte-Carlo techniques. The sample approximation of the penalty function portfolio problem (3) can be formulated as ˆϕ S N = min r + N (r,x,y) R X S [ S (Ri s c i )Q i x i + + f i y i r]. (6) In the last problem, no additional integer (binary) variables are necessary. The variables which are necessary to replace the positive parts are continuous (nonnegative) and the resulting problem is ˆϕ S N = min r + N S (r,x,y,v) R X R S S v s + v s (Ri s c i )Q i x i + f i y i r. (7) Sample average approximations of stochastic programming problems with expectation type objectives, where also the penalty function problem belongs, were studied by [13]. 4 Numerical study and comparison In this section, we compare the approaches for solving the portfolio optimization problems, or rather the ability of both sample approximated problems to generate a feasible solution of the original portfolio problem (1). We consider 13 most liquid assets which are traded on the main market (SPAD) on Prague Stock Exchange. Suppose that the small investor trades assets on the mini-spad market. This market enables to trade mini-lots (standardized number of assets) with favoured transaction costs. Weekly returns from the period 6th February 2009 to 10th February 2010 are used to estimate the parameters of the multivariate skewed t-distribution, see [3]. Initial prices of minilots are entered in Table 2, the fixed transaction costs were set to 80 CZK and the proportional to 5 %. We generated 100 samples for each sample size S, i.e. 100 S realizations, from the multivariate skewed t-distribution. The software R and the package fassets were used to estimate the parameters and to simulate the samples. We used the modeling system GAMS and the solver Ilog CPLEX 12.1 to solve the sample approximations of the chance constrained problems (5) and the penalty function problems (7) for different sample sizes S, levels ε and penalty parameters N. Descriptive statistics for the results are contained in Tables 3, 4, 5. As we can see from Table 5, the Penalty term [ ˆP N S = N E (R i c i )Q i x i + ] + f i y i r really decreases with increasing penalty parameter N and reduces violations of the constraint (R i c i )Q i x i + n f iy i r 0. To verify the reliability of the obtained optimal solutions, we used the independent samples of 10 000 realizations from the skewed t-distribution which was used to model the random returns. The columns Reliability contain relative number of realizations for which the chance constraint is fulfilled. As can be easy seen, the reliability of the obtained solutions increases with increasing levels ε and penalty parameters N for each sample size S. Both problems are also able to generate comparable solutions for the same sample sizes, see Tables 3, 4. Furthermore, we can compare the descriptive statistics of the optimal values ˆψ ε S, ˆϕ S N and the optimal solutions ˆrS N of the problems. We observe that the variability of the values increases with the sample size. Thus, we pay for the increasing reliability of the optimal solutions by decreasing reliability of the optimal values when we increase the size of the sample.
Reliability ˆψS ε S ε min max mean st.dev mean st.dev 500 0.1 0.9807 0.9985 0.9934 0.0034 73526.55 17562.79 500 0.05 0.9807 0.9985 0.9934 0.0034 73526.55 17562.79 500 0.01 0.9807 0.9985 0.9935 0.0034 73704.40 17557.08 500 0.001 0.9815 0.9987 0.9938 0.0032 74470.68 17609.86 1000 0.1 0.9896 1.0000 0.9976 0.0018 118530.63 43847.79 1000 0.05 0.9896 1.0000 0.9976 0.0018 118530.63 43847.79 1000 0.01 0.9896 1.0000 0.9976 0.0018 118565.79 43940.23 1000 0.001 0.9904 1.0000 0.9978 0.0017 118917.79 43838.37 5000 0.1 0.9998 1.0000 1.0000 0.0000 771456.64 155823.73 5000 0.05 0.9998 1.0000 1.0000 0.0000 771456.64 155823.73 5000 0.01 0.9998 1.0000 1.0000 0.0000 771466.64 155822.02 5000 0.001 0.9998 1.0000 1.0000 0.0000 771929.10 155601.89 Table 3: Chance constrained problems - reliabilities and optimal values Reliability S N min max mean st.dev 500 1 0.0000 0.0029 0.0000 0.0003 500 10 0.8684 0.9306 0.8991 0.0126 500 100 0.9722 0.9962 0.9878 0.0048 500 1000 0.9825 0.9995 0.9939 0.0033 500 10000 0.9822 0.9995 0.9938 0.0033 1000 1 0.0000 0.0011 0.0000 0.0001 1000 10 0.8682 0.9207 0.8981 0.0117 1000 100 0.9805 0.9962 0.9900 0.0034 1000 1000 0.9897 0.9999 0.9974 0.0018 1000 10000 0.9899 1.0000 0.9978 0.0018 5000 1 0.0000 0.0000 0.0000 0.0000 5000 10 0.8922 0.9210 0.9052 0.0055 5000 100 0.9889 0.9994 0.9946 0.0022 5000 1000 0.9994 1.0000 1.0000 0.0001 5000 10000 0.9999 1.0000 1.0000 0.0000 Table 4: Penalty function problems - reliabilities 5 Conclusion Various stochastic programming methods were applied to the portfolio optimization problem. The numerical study shows that not only the sample approximated chance constrained problems but also the approximated penalty function problems are able to generate the solutions which are feasible for the original chance constrained problem with a high reliability. Acknowledgements This work was supported by the grants GA CR 201/08/0486, GD CR 402/09/H045 and SVV 261315/2010. References [1] Ahmed, S., and Shapiro, A.: Solving chance-constrained stochastic programs via sampling and integer programming, In Tutorials in Operations Research, Z.-L. Chen and S. Raghavan (eds.), INFORMS (2008). [2] Angelelli, E., Mansini, R., and Speranza, M. G.: A comparison of MAD and CVaR models with real features, Journal of Banking and Finance 32 (2008), 1188 1197.
ˆr S N ˆϕ S N ˆP S N S N mean st.dev mean st.dev mean st.dev 500 1-6982091.03 2281425.98-18507.71 10646.86 6963583.32 2276247.33 500 10 27657.70 6512.57 41121.83 8694.36 13464.12 3421.64 500 100 59900.85 12308.70 67361.07 13924.12 7460.22 4201.23 500 1000 74499.36 17418.17 74499.36 17418.17 0.00 0.00 500 10000 74382.34 17488.41 74382.34 17488.41 0.00 0.00 1000 1-7336065.18 1943505.65-12914.30 7474.55 7323150.88 1939995.39 1000 10 33155.27 8581.14 54569.62 15098.62 21414.36 9660.52 1000 100 83733.79 28950.26 98478.10 34757.21 14744.30 7877.06 1000 1000 119738.94 44439.16 119805.63 44548.26 66.69 666.87 1000 10000 119469.73 43945.57 119469.73 43945.57 0.00 0.00 5000 1-8251050.64 966771.88-6402.58 3736.18 8244648.07 966112.70 5000 10 32652.50 7338.37 89631.19 11841.45 56978.69 10639.72 5000 100 147268.59 35464.11 338818.24 85184.11 191549.65 91832.27 5000 1000 662059.99 170279.40 724297.68 158256.44 62237.69 52108.28 5000 10000 776120.65 156398.57 776120.65 156398.57 0.00 0.00 Table 5: Penalty function problems - optimal values and solutions [3] Azzalini, A., and Capitanio, A.: Distributions generated by perturbation of symmetry with emphasis on a multivariate skew t-distribution, Journal of the Royal Statistical Society: Series B 65 (2003), 367 389. [4] Bazara, M. S., Sherali, H. D., and Shetty, C. M.: Nonlinear programming: theory and algorithms, Wiley, Singapore, 1993. [5] Branda, M.: Reformulation of general chance constrained problems using the penalty functions, Stochastic Programming E-print Series (SPEPS), 2010-2. [6] Branda, M., and Dupačová, J.: Approximations and contamination bounds for probabilistic programs, Stochastic Programming E-print Series (SPEPS), 2008-13. [7] Dupačová, J., Gaivoronski, A., Kos, Z., and Szantai, T.: Stochastic programming in water management: A case study and a comparison of solution techniques, European Journal of Operational Research 52 (1991), 28 44. [8] Ermoliev, Y. M., Ermolieva, T. Y., Macdonald, G. J., and Norkin, V. I.: Stochastic optimization of insurance portfolios for managing exposure to catastrophic risks, Annals of Operations Research 99 (2000), 207 225. [9] Kopa, M., and Chovanec, P.: A Second-Order Stochastic Dominance Portfolio Efficiency Measure, Kybernetika, vol. 44, num. 2 (2008), 243 258. [10] Luedtke, J., and Ahmed, S.: A sample approximation approach for optimization with probabilistic constraints. SIAM Journal on Optimization, vol. 19 (2008), 674 699. [11] Prékopa, A.: Probabilistic Programming. In: Stochastic Programming, Handbook in Operations Research and Management Science Vol. 10 (A. Ruszczynski and A. Shapiro, eds.), Elsevier, Amsterdam, 483 554, 2003. [12] Rockafellar, R.T., and Uryasev, S.: Conditional Value-at-Risk for General Loss Distributions. Journal of Banking and Finance 26 (2002), 1443 1471. [13] Shapiro, A.: Monte Carlo Sampling Methods. In: Stochastic Programming, Handbook in Operations Research and Management Science Vol. 10 (A. Ruszczynski and A. Shapiro, eds.), Elsevier, Amsterdam, 483 554, 2003.