UFDC Home  Search all Groups  UF Institutional Repository  UF Institutional Repository  UF Theses & Dissertations   Help 
Material Information
Thesis/Dissertation Information
Subjects
Notes
Record Information

Full Text 
PAGE 1 1 SAMPLE PATH BASED OPTIMAL POSITION LIQUIDATION WITH CVAR RISK By SUIYI SU A THESIS PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE UNIVERSITY OF FLORIDA 2012 PAGE 2 2 2012 S uiyi Su PAGE 3 3 This thesis is dedicated t o my parents who support me all t he way from the beginning of this study It is also dedicated to my lovely girlfriend for her u nderstanding during my research PAGE 4 4 ACKNOWLEDGMENTS I would like to express my sincere gratitude to my advisor, Professor Stan Uryasev, Director of Risk Management and Financial Engineering Lab University of Florida, for his continuous support to patience, encouragement and guidance, I would not have finished the present thesis. I am also grateful to my co advisor, Professor Guanghui Lan, for his sugg estions and understanding during the writing of this thesis. My warm thanks also goes to Dr. Pavlo Krokhmal Blunt Cynthia, Peter Tsyurmasto and my friends who hav e provided their assistance during my study. I owe my loving thanks to my mother Huixian Qu, my father Sha Su and my girlfriend Kun Zhao. Their support and encouragement always helped me in the hardest time in my life and study. PAGE 5 5 TABLE OF CONTENTS page ACKNOWLEDGMENTS ................................ ................................ ................................ .. 4 LIST OF TABLES ................................ ................................ ................................ ............ 7 LIST OF FIGURES ................................ ................................ ................................ .......... 8 LIST OF ABBREVIATIONS ................................ ................................ ............................. 9 ABSTRACT ................................ ................................ ................................ ................... 10 CHAPTER 1 INTRODUCTION ................................ ................................ ................................ .... 11 1.1 Motivation ................................ ................................ ................................ ...... 11 1.2 Related Work ................................ ................................ ................................ 12 1.3 Overview of Thesis ................................ ................................ ........................ 13 2 BACKGROU ND ................................ ................................ ................................ ...... 15 3 SAMPLE PATH MODEL ................................ ................................ ......................... 17 3.1 Objective Function ................................ ................................ ............................ 17 3.2 Price Impact Function ................................ ................................ ....................... 20 3.2.1 Perfect Frictionless Market ................................ ................................ ...... 21 3.2.2 Temporary Market Impact ................................ ................................ ....... 21 3.2.3 Permanent Market Impact ................................ ................................ ....... 22 3. 3 Constraints ................................ ................................ ................................ ........ 22 3.3.1 Nonanticipativity Constraints ................................ ................................ ... 23 3.3.2 Monotonicity Constraints ................................ ................................ ......... 25 3.3.3 Risk Constraints ................................ ................................ ...................... 25 3.4 Lower Bound Problem ................................ ................................ ...................... 26 4 CASE STUDY ................................ ................................ ................................ ......... 30 4.1 Data ................................ ................................ ................................ .................. 30 4.2 Optimization Problems ................................ ................................ ...................... 30 4.2.1 Problem 1 ................................ ................................ ................................ 31 4.2.1.1 Mathematical format ................................ ................................ ....... 31 4.2.1.2 Portfolio safeguard format ................................ .............................. 32 4.2.2 Problem 2 ................................ ................................ ................................ 32 4.2.2.1 Mathematical format ................................ ................................ ....... 32 4.2. 2.2 Portfolio safeguard format ................................ .............................. 33 PAGE 6 6 4.2.3 Problem 3 ................................ ................................ ................................ 33 4.2.3.1 Mathematical format ................................ ................................ ....... 33 4.2.3.2 Portfolio safeguard format ................................ .............................. 34 4.3 Results ................................ ................................ ................................ .............. 34 4.3.1 Lower bound Optimal Trading Strategy ................................ ................... 34 4.3.2 Computational Performance ................................ ................................ .... 37 5 CONCLUSION ................................ ................................ ................................ ........ 39 5.1 Computational Ef ficiency ................................ ................................ .................. 39 5.2 Future Work ................................ ................................ ................................ ...... 41 APPENDIX A PROBLEM STATEMENT FOR PSG RUN FILE ................................ ..................... 43 Problem 1 ................................ ................................ ................................ ............... 43 Problem 2 ................................ ................................ ................................ ............... 43 Problem 3 ................................ ................................ ................................ ............... 43 B MATLAB SCRIPT TO GENERATE INPUT MATRICES ................................ .......... 45 Matrices Generating Script for problem 1 and 3 ................................ ..................... 45 Matrices Generating Script for Problem 2 ................................ ............................... 49 Function to Print Data into Packed Matrices ................................ ........................... 52 Function to Print Data into Full Matrices ................................ ................................ 53 LIST OF REFERENCES ................................ ................................ ............................... 55 BIOGRAPHICAL SKETCH ................................ ................................ ............................ 56 PAGE 7 7 LIST OF TABLES Table page 4 1 Optimal Solution to Problem 1 with K=2000 ................................ ....................... 35 4 2 Optimal Solution to Problem 3 with K=2000 ................................ ....................... 35 4 3 Solving Time for Problem 1, 2 and 3 ................................ ................................ .. 37 5 1 Sizes of Problem 1 and Problem 2 ................................ ................................ ..... 4 0 PAGE 8 8 LIST OF FIGURES Figure page 2 1 Run File Environment in Portfolio Safeguard ................................ ..................... 15 3 1 Grouping Method and Decision Variables ................................ .......................... 23 3 2 ................... 24 4 1 Lower Bound Optimal Values with Different Group Numbers and Fixed Sample Size J = 2000 ................................ ................................ ......................... 36 4 2 Solving Time of Optimization Problem 2 with Variable Numbers of Group and Sample Paths ................................ ................................ ................................ ..... 38 5 1 Solving Time for Problem 1 and 2 ................................ ................................ ...... 40 PAGE 9 9 LIST OF ABBREVIATION S PSG Portfolio Safeguard, the software package that is used in implementing the case study CVaR Conditional Value at Risk, a downside percentile type measure of the loss function PAGE 10 10 Abstract of Thesis Presented to the Graduate School of the University of Florida in Partial Fulfillment of the Requirements for the Deg ree of Master of Science SAMPLE PATH BASED OPTIMAL POSI TION LIQUIDATION WITH CVAR RISK By Suiyi Su August 2012 Chair: Stan Uryasev Major: Industrial and Systems Engineering The purpose of this research is to investigate devising the optimal position liquidation strat egies in financial markets. During the transaction of large block orders, investors need to maximize their profits against the losses caused by price slippage. We employed a sample path based stochastic programming ap proach to obtain a dynamic lower bound optimal trading strategy with Conditional Value at Risk constraint W e analyzed the optimization problem s with different types of objective function s determined by distinct market impact functions. N onanticipativity a nd risk constraints are discussed and properly imposed to avoid anticipating solutions and to control risk A new formulation is proposed to obtain a lower bound of the optimal p osition liquidation problem. A case study is implemented in the run file environment of Portfolio Safeguard. Lower bound optimal strategies are obtained from problems with and without risk constraints. The result also verifies the supposed improvement of computational efficiency in th e new formulation. PAGE 11 11 CHAPTER 1 INTRODUCTION In the realm of quantitative finance, portfolio choice and asset allocation is the strategic level decisions With the rise of computerized trading and the increasing speed of execution, the operational level decision making p lays a more important role in achieving the thinner profit margin than ever Precisely speaking, trading execution optimization is to seek an optimal trading sequence in maximizing payoff while co ntroling risk with predefined financial decisions. 1.1 Motivation During the transaction of large block orders there is always a potential loss caused by price slippage, or market impact that reduce s the expected return of the trade. This price slippage origi nates from the so called supply demand imb alance discussed in Perold (198 8) and information leakage investigated by Kissell and Glantz (2003). The market equilibrium tends to move the price adversely to strike a balance between buy ing and sell ing power T his price shift soon disappears as the adverse price movement attracts more orders come to provide liquidity and thus this effect is temporary market impact Whenever an order is placed to the market, it is always considered conveying certain information with regard to the asset. This information affects the other market participants and forces th e supply demand equilibrium to balance at a different price In other words, the information leakage incurs permanent market impact that will exist d uring our trade. An empirical evidence of this pot ential loss provided by Perold (198 8) is a statistical comparison between a hypothetical portfolio and a real portfol io constructed according to same criteria. He showed that the hypothetical portfolio con sistently PAGE 12 12 outperformed the real portfolio for 20 years. A fair explanation is the market impact caused by the traders own execution s In order to estimate the effect of this phenomenon and to devise an optimal trading execution, researchers suggest a varie ty of models and techniques to get a solution. Most of their research assumes to trade a block of shares of a financial instrument within a fixed time period By slicing the block order into small pieces the strategy aims to maximize expected profit or minimize expected cost while employing certain measures to control risk. 1.2 Related Work The first quantitative approach to optimize trading execution was described by Bertsimas and Lo (1998). They derived a mathematical formulation to minimize the expected cost of trading in a discrete time random walk model. By assuming the law of motion being a linear function of trading size and being either tempora ry or permanent, they used stochastic dynamic programming and go t a close form expressions for the optimal execution strategies. They also employed an approximate dynamic programming to solve the problem incorporating a serially correlated information factor in the market impact function. Bersimas, Lo and Hummel (1999) and AitSahlia, Sheu and Pardalos (2008) extend ed this approach to consider the optimal execution for portfolio with multiple assets. Khemchandani and et al. (2012) derived an analytical expression with the market impact being a linear combination o f temporary and permanent function s Without risk constraints in their models, the optimal trading strategies given by these models are only acceptable by risk neutral investors. PAGE 13 13 Almgren (2001) considered the problem in the classical mean variance perspect ive. By constructing an expected utility in the objective function, he formulated the problem in a continuous time model where market impact is linear to the shares traded in both temporary and permanent situations. One of his contributions is to incorpor ate risk in the problem and get a solution in efficient frontier form. Another discovery made by Almgren (2001) is that under the assumption of independent random walk without information, the static strategy is the same as the dynamic strategy that is op timal to the problem. The nonlinear extensions of the model are discussed in Almgren and Robert (2003) where they obtained an explicit expression of the optimal execution strategy with market impact function being a simple power law. Almgren (2007) and Lor enz (2011) further considered an adaptive trading strategy that is continuously modified by market information, their optimal adaptive policies turned out to be Krok hmal and Uryasev (2007) proposed a sample path based approach to optimal position liquidation. They utilized historical price data to generate a discrete time sample path graph based on which they discussed the optimal position liquidation strategies with market impact function being a general form. In order to circumv ent the feasibility and optimality of the problem, the author proposes a DC programmin g approach to estimate the lower bound of the original problem. 1.3 Overview of Thesis The weakness of the model formulated by Krok hmal and Uryasev (2007) is that the non convexity brought in by nonanticipativity constraint makes the problem PAGE 14 14 extremely difficul t to solve. It is still computationally inefficient to obtain an optimal solution for the lower bound problem. In this thesis, we reformulated the lower bound optimal execution problem and take advantage of the convex programming solvers in Portfolio Safe guard to improve the computational efficiency. In Chapter 2, we briefly introduce the run file environment of the Portfolio Safeguard software package and the functions we will use in the case s tudy. In Chapter 3, we discuss details in the sample path bas ed model such as the form of objective functions, nonanticipativity cons traints and risk constraints. A new formulation with reduced size is proposed by the end of Chapter 3. In Chapter 4, we consider three specifi c optimization problems and use PSG to imp lement a case study. Both mathematical format and PSG format formulation s are presented in Chapter 4. The PSG format is easily translated into problem statement that is readily to be processed by solvers in PSG. Conclusions and future work are presented i n Chapter 5. A remarkable improvement in the computational efficiency is shown by the comparing the outputs from the three problems. We further di scuss some possible future work and the ultimate goal of the research in this thesis. PAGE 15 15 CHAPTER 2 BACKGROUND P ortfolio Safeguard (PSG) is a Windows based decision support tool for solving a wide range of optimization, statistics, and risk management problems. Focus applications areas are risk management, financial engineering, military, and medical applications. P SG includes various case studies mostly concentrated on financial applications such as portfolio optimization, asset allocation, selection of insurance, hedging with derivative contracts, bond matching, and structuring of Collateralized Debt Obligation (CDO). The run file environment of PSG provides an efficient way to solve an optimization problem. By writing a short problem statement and preparing the input data following the paradigm requested by PSG, we can obtain a solution that is stored in some text files. The following figure show s an example of the run file environment: Figure 2 1. Run File E nvironment in Portfolio Safeguard PAGE 16 16 The functions and their mathematical definitions used in the case study are presented as follows: avg_g : Average gain function max_risk: Maximum risk for loss cvar_risk: CVaR risk for loss avg_max_risk_g: Average max risk for Gain Where has J discrete scenarios M = number of random Loss Functions vector of random coefficients for Loss Function scenario of the random vector is a random function with scenarios PAGE 17 17 CHAPTER 3 SAMPLE PATH MODEL In this chapter, we describe the problem in formal mathematical notations and propose the reduced size reformulation to calculate the lower bound of the problem. Different from assuming a random walk in traditional models, the sample path model is driven by data in simulating the natural price movement. A sample path graph with finite time periods should be generated from the historical data with normalized initial prices. Every node in this graph represents the no impact price, which is the price movement independent of our trades. Then we discuss the possible impacts caused by our trades on the current no impact prices: we start from a perfect frictionless market and extend it to a linear impact function to incorporate temporary and permanent impact During the process of problem formulating and solving the application of multistage stochastic programming may cause a special problem called nonanticipativity We ne ed to handle this error take advantage of the perfec t information of future prices. A p ath grouping (or path bundling) method and a decision rule can be introduced to eliminate the ability of anticipating. We discus s some heuristics in path grouping and decision rule due to several intuitive considerations. Finally, we modify the model to add risk constraints to satisfy investors different risk preferences. 3.1 Objective Function In this section we derive a general form of objective with implicit payoff function in a discrete timeframe In the following sections, we discuss different type of payoff functions and the corresponding explicit expressions of objectives. PAGE 18 18 Suppose at time there is a position of shares of an asset, which is to be completely closed within a finite time interval The initial position level can be either positive or negative: in th e former case, we need to seek a selling strategy to liquidate a long position; while in the latter one, a buying strategy is needed to close a short position. In this thesis, we concentrate on liquidating a long position. Another concern about X is that i t can be a vector meaning that we have a portfolio of more t han one asset to sell at initial time. We rule this situation out and assume X to be a number which means there is only one asset in our portfolio. In this discrete time model, trades are only allowed at predefined time points Though the time intervals are not necessarily to be equally divided, we need to maintain our trades throughout all paths to coincide at Let be the index of sample path and be the sample path set 3 1 Each element stands for the normalized no impact price of the asset on path at time Price on every path is normalized the by dividing them by the initial price. Thus, we can obtain: Similarly, we define the set of trading strategy in accordance with the sample p ath set 3 2 PAGE 19 19 Every element in the set is the normalized value of position on path j at time t The normalized values are also divided by the initial position value, and Since we are committed to completely liquidate the position, we should close our position out by time : For convenience, we define the execution decision s as the difference of two positions in two consecutive time points: 3 3 The positive values of mean the execution to sell the asset at time t; the negative values, on the other hand, is to buy the asset and increase the level of current position. In the situation where initial position it is natural to assume that no buy execution is allowed in the sell strategy. Let the function be the payoff at time In general, is a function depend on all execution decisions and prices prior to time : The objective of our optimal execution problem is to maximize the sum of expected payoffs incurred by each execution decisions on path at time : 3 4 PAGE 20 20 Considering the sample paths to be equally pro bable, we rewrite Eq. 3 4 as 3 5 Eq. 3 5 is the general form of objective function that is to be optimized in our problem. In order to obtain an explicit form of objective function, we need to discuss the price impact function and the corresponding of the payoff function 3.2 Price Impact Function In this section, we discuss the type of the payoff function and resulting objective function in: a) perfect frictionless market with no market impact; b) temporary market impact; c) permanent market impact. Imagine that market impact exists in our model, the real price we make a sell executi on will deviate from the no impact price. Let be the real price on path at time We define as the market impact function or impact function : 3 6 The payoff function and the corresponding objective function then become: 3 7 3 8 PAGE 21 21 3.2.1 Perfect Frictionless Market In a perfect frictionless market, there is no market impact associated with our trades. Though it is not a practical assumption in reality, it has experimental meanings to test the approximation methods and algorithms proposed in the thesis. In a perfect frictionless market, the re al price equals to the no impact price and payoff function at time is equal to the current no impact price multiply by the current execution decision: The objective function i n this situation is: 3 9 Since is a linear function of decision variables, the objective function is also a linear function of variables 3 10 3.2.2 Temporary Market Impact Market impact is called temporary when the real price is only influenced by current execution decision and independent of the previous execution decisions. If we further assume the impact function is linear to the current exec ution decisions, we can express the impact function and the payoff as: PAGE 22 22 where is a constant coefficient estimates the market impact. The objective function then becomes: 3 11 The objective is a quadratic function of variables 3.2.3 Permanent Market Impact Similarly, when the market impact is general permanent, current real price depends on not only the current trade, but also all previous execution decisions. If we continue assuming linearity of the impact function, we obtain: The objective function then becomes: 3 12 It is also a quadratic function of variables 3.3 Constraints In this section, three groups of constraints are introduced to circumvent anticipa ting solutions to avoid buy execution in a sell strategy and to control risk. PAGE 23 23 3.3.1 Nonanticipativity Constraints In section 3.2, we have established the explicit forms of objectives under different market impact functions. In these equations, we assigned one decision variable to each time point This formulation might result in an unwanted ability of the model called anticipativity Briefly speaking, the anticipativity in multi stage stochastic programming is the ability to take advantage of the perfect future information provided by t he structure of the formulation. However, the perfect information about future is not predictable when making current execution decisions. In order to eliminate the anticipativity we need to impose a set of nonanticipativity constraints. In our study, the se constraints forces the execution decisions which share the similar current prices must also be similar to each other. To impose nonanticipativity constraints, we need to employ a grouping method and a decision rule to define the of the pric es execution decisions in a mathematical way Figure 3 1. Grouping Method and Decision Variables PAGE 24 24 The grouping method used in this thesis requires that the price are equally divided to groups such that every group has equal number of nodes and the node with higher price must have higher index. For instance, in Figure 3 1 at time the three nodes on the bottom belong to group 1, the middle three nodes belong to group 2 and the three nodes on the top belong to group 3. Let be the total number of groups we have on every time point and be the decision variables associated with each group. A decision rule can be introduced based on these group decisio n variables. We 3 13 where is a function that returns the value of group index that corresponds to the price Figure 3 (Courtesy of Krokhmal and Uryasev) e is that when we make execution decisions, we first compare the current position and the optimal position indicated by PAGE 25 25 group decision variables: if the current position is low er than group decision variable keep it; otherwise, reduce it to the position r equired by the group decision variables. We can see from Figure 3 2 at time on path variables coincide with group decision variables as the group variables cut the current position to a lower level while at time we keep the position to be the same since the group decision variable is higher than previous sample path variable. 3.3.2 Monotonicity Constraints Th e idea that no buy execution is allowed in the sell strategy leads to a set of monotonicity constraints: 3 14 Recall the definition of Eq. 3 3, we equivalently write the constraint as: 3 15 3.3.3 Risk Constraints In this thesis, we measure the risk in terms of Co nditional Value at Risk (CVaR) invented by Rockafellar and Uryasev ( 2000, 2002). CVaR is a quantile risk measure of the distribution of a loss function The favorable part of taking Conditional Value at Risk is that it ensures the convexity of the risk constraints which greatly simplify in solving the problem using stochastic programming techniques. We follow the paradigm of Rockafellar and Uryasev (2000, 2002) and multiply the gain function in objective by 1 and transfer it into a loss function. PAGE 26 26 When solving the problem in Portfolio Safeguard, we simply call the function cvar_risk to calculate the CVaR risk of a loss function. Thus, we will not elaborate on the theoretical part of the risk cons traints and write 3 16 as a general expression of the risk constraints. The on the right hand side of the inequality is a constant representing the threshold of the risk. 3.4 Lower Bound Problem Combining the results from previous sections, an optimal execution problem with general objective is presented. Then we take the objective in frictionless market as an example to derive an equivalent convex problem and discuss the approximation methods to calculate the lower bound of the optimization problem. By using the objective in the form of Eq. 3 5, and constraints from section 3.3, we write a general formulation of the optimal execution problem: 3 17 PAGE 27 27 Consider the situation where the market is perfect frictionless, the objective take the form in Eq. 3 10 and the optimization problem reads: max 3 18 Notice that when adding the nonanticipativity constraints, the feasible region becomes a non convex set. In order to solve the problem efficiently, we transform the problem into an equivalent convex problem: 3 19 It is proved by Krokhmal and Uryasev (2007) that this formulation is equivalent to Eq.3 18 in the sense that optimal values of their objectives are equal, and the sets of their optimal solutions in variables coincide. PAGE 28 28 Ignoring the max operator in objective, we actually obtain an optimization problem with the solution of a l ower bound of the original problem: 3 20 I n this formulation the number of decision variables equals to This means the size of the problem increases linearly to the size of sample paths. In order to reduce the problem size, we introduce a nonlinear formulation equivalent to Eq. 3 20 that can be incorporated by functions in Portfolio Safeguard. 13: substitute by we obtain: Repeat this replacing process, we get: furthermore, since we obtain: 3 21 PAGE 29 29 Substitute Eq. 3 21 into the objective of Eq. 3 20 and notice the first constraint of Eq. 3 20 is naturally contained in Eq. 3 21, we write an equivalent optimization problem to Eq. 3 20 as follows: 3 22 s.t. The advantage of this formulation is that it eliminates the redundant decision variables and contains the nonanticipativity constraints implicitly in the objective. With only group decision variables t he size of the problem is linear to the number of groups that is determined by the grouping method. On the other hand, the transformation makes this problem a non linear programming. In Chapter 4, we will see that by utilizing the convex programming solve rs and proper functions in Portfolio Safeguard, this optimization problem can be solved much more efficiently than Eq. 3 20. PAGE 30 30 CHAPTER 4 CASE STUDY This case study compares the trading strategies generated by Eq. 3 20 and Eq. 3 22 as well as their computational efficiency. W e add the CVaR risk constraints to Eq. 3 20 and solves for a risk averse trading strategy. All case studies are solved in run fil e environment of PSG The preprocessing of the input data is implemented in MATLAB All programs are run on a 2.50 GHz personal computer. 4.1 Data The dataset used in our case study has two parts, the first set contains 5000 sample paths that have been cal culated from real historical data; and the second set has 15000 sample paths that are artificially generated by taking the average of two random sample prices from the first set. For the first dataset, we employ an algorithm to recognize certain patterns in the trajectory of a stock then we keep track of its closing prices for a 5 business day cycle and the opening prices in the first day. All sample prices are normalized to start from 1. With little loss of generality, discounting is neglected because of the short time horizon. The second dataset is generated to test the computational efficiency for Eq. 3 22. Since the prices are the average of two random real prices, the trajectory might have little practical meanings in producing a trading strategy. Howe ver, the similarity of the data patterns makes it reasonable to be used in testing the performance of the algorithm. 4.2 Optimization Problems In this section, we present three optimization problems in both mathematical format and PSG format. The PSG forma t uses existing functions in the software PAGE 31 31 package and some properly defined sets of variables. It is easy to convert the PSG format formulation into a problem statement that is ready to be read by solvers in PSG. We define some sets and functions as follow s: is the loss function; is the set of payoff on each path; is the set of difference function between and ; is the set of difference function between and ; is the set of difference function between and 4.2.1 Problem 1 Optimization problem 1 uses the formulation from Eq. 3 20 to solve the optimal execution problem in perfect frictionless market with no risk constraint. 4.2.1.1 Mathematical f ormat Maximizing expected sum of payoffs: 4 1 s ubject to n onanticipativity constraints: PAGE 32 32 m onotonicity constraints: b oundary constraints: 4.2.1.2 Portfolio safeguard f ormat Maximizing expected sum of payoffs: 4 2 subject to nonanticipativity constraints: monotonicity constraints: boundary constraints: 4.2.2 Problem 2 Optimization problem 2 uses the formulation from Eq. 3 22 to solve the optimal execution problem in perfect frictionless market with no risk constraint. 4.2.2.1 Mathematical f ormat Maximizing expected sum of payoffs: 4 3 PAGE 33 33 subject to boundary constraints: 4.2.2.2 Portfolio safeguard f ormat Maximizing expected sum of payoffs: 4 4 subject to boundary constraints: 4.2.3 Problem 3 Optimization problem 2 uses the formulation from Eq. 3 22 to solve the optimal execution problem in perfect frictionless market with CVaR risk constraint. 4.2.3.1 Mathematical f ormat Maximizing expected sum of payoffs: 4 5 Subject to risk constraint: n onanticipativity constraints: m onotonicity constraints: PAGE 34 34 b oundary constraints: 4.2.3.2 Portfolio safeguard f ormat Maximizing expected sum of payoffs: 4 6 subject to risk constraint: nonanticipativity constraints: monotonicity constraints: boundary constraints: 4.3 Results 4.3.1 Lower bound Optimal Trading Strategy According to the results of the numerical experiments, Problem 1 and 2 yield the same trading strategy as expected. We present and compare the trading strategies generated from the first two problems and from Problem 3 with 2000 sample path in the dataset. PAGE 35 35 There are three sets of parameters in our models: group number confidence level and risk threshold We conducted separate experiments using 2000 sample paths and different values of to investigate the relationship between and the optimal value. We set for all problems in t he case study. Noting that improper values of might make optimization problem infeasible, we first read the risk value in a risk unconstrained problem and then reduce this value by a reasonable portion and check the optimality of the solution. Table 4 1. Optimal Solution to Problem 1 with K=2000 No risk constraint Optimal Value = 1.019 6 k t=1 t=2 t=3 t=4 t=5 1 1 1 1 1 0 2 1 1 1 1 0 3 1 1 1 0 0 4 1 1 1 1 0 5 1 1 1 1 0 6 1 1 1 0 0 7 1 1 1 0 0 8 1 1 1 0 0 9 1 1 1 0 0 10 1 1 1 0 0 Table 4 2. Optimal Solution to Problem 3 with K=2000 CVaR risk constraint Optimal Value = 1.0158 k t=1 t=2 t=3 t=4 t=5 1 0.891 0.746 0.746 0.439 0.000 2 0.746 0.746 0.439 0.228 0.000 3 0.746 0.746 0.591 0.000 0.000 4 0.746 0.746 0.746 0.439 0.000 5 0.746 0.746 0.746 0.308 0.000 6 0.746 0.746 0.700 0.000 0.000 7 0.890 0.746 0.746 0.000 0.000 8 0.746 0.746 0.746 0.000 0.000 9 1.000 0.746 0.746 0.000 0.000 10 0.746 0.746 0.746 0.000 0.000 PAGE 36 36 3, the trading strategy is completely contained in the group decision variables, i.e. the values of Table 4 1 shows the lower bound optimal trading strategy with no risk constraint in frictionless market is a 0 1 strategy. The trading strategy sells the entire asset at the most favorable time point along the path because the optimization problem merely tries to maximiz e the expected payoff by ignoring any kind of risk. In contrast in Table 4 2 the risk constrained problem yields a strategy makes proportional and earlier execution than the risk unconstrained strategy. It avoids the timing risk caused by hold ing the ass et and expecting a better trading opportunity. However, the reduction of risk is at the cost of decreasing of expected return. This conclusion matches the mean variance theory in optimal execution problem proposed by Almgren ( 2001 ). Figure 4 1. Lower Bou nd Optimal Values with Different Group Numbers and Fixed Sample Size J = 2000 Figure 4 1 shows that the increase in group number results in the improvement of large number of mean s strong ability to anticipate. Consider the case when 1 1.005 1.01 1.015 1.02 1.025 1.03 1.035 1.04 1.045 1.05 1 10 100 500 1000 2000 Lower bound optimal value Group number PAGE 37 37 the strategy is static since the execution decisions will not be modified according to the updates of market information. On the ot her hand if equals to the number of sample paths, the strategy is completely anticipating: the stock will be sold at the highest price along every sample paths. It is reasonable to set in our case stud y because the optimal value tends to be stable when ranges from 1 to 100 for 2000 sample paths. We say it is not acceptable to choose large value for for that the prices cannot clearly distinguish current trajectory from others and the model is non anticipating. 4.3.2 Computational Performance With the increase of sample paths, optimization problem 2 shows its advantage over optimization problem 1 in handling large dataset. Table 4 3 Solving Time for Problem 1, 2 and 3 Problem Datasets Problem 1 Problem 2 Problem 3 Dataset 1 (J=10, K=5) < 0 .01 s < 0 .01 s <0. 0 1 s Dataset 2 (J=100, K=10) 0.05s 0.02s 0.25s Dataset 3 (J=1000, K=10) 3.99s 0.05s 23.94s Dataset 4 (J=2000, K=10) 24.54s 0.12s 771.76s The table above shows that with the increase of sample path, the solving time of Problem 1 also increases but that of Problem 2 stays at a low level. This is because the num ber decision variables used in F ormulation 4 1 is proportional to the number of sample paths (J) w hile the number of decision variables in Formulation 4 3 is proportional to group number (K). Since group number is fixed to be 10 when sample PAGE 38 38 paths ranges from 100 to 2000, the solving time of Problem 2 does not show noticeable rise. Since the CVaR risk m easure introduce a nonlinear constraint into the problem, optimization problem 3 tends to consume more time than Problem 1 even using the same formulation. In order to examine the property of Formulation 4 3, we conduct the experiment with group number being 10, 50, 100 and sample paths being 1000, 2000, 5000, 10000, 15000 and 20000. Figure 4 2. Solving Time of Optimization Problem 2 with Variable Numbers of Group and Sample Path s Figure 4 2 shows that with fixed group number, for Formulation 4 3, solv ing time increases slightly with the expansion of sample paths. The time complexity of Formulation 4 3 is mainly determined by group number. 0 0.5 1 1.5 2 2.5 3 3.5 4 1000 2000 5000 10000 15000 20000 Soling time (s) Number of sample paths K = 100 K = 50 K = 10 PAGE 39 39 CHAPTER 5 CONCLUSION In this thesis, we proposed a new formulation to the lower bound optimal execut ion problem ba sed on the sample path model. Through this reformulation, we successfully eliminate the redundant variables and effectively reduce the problem size. Though introducing a nonlinear factor in the objective function, this nonlinearity is properly handled by t he functions and convex programming solvers in Portfolio Safeguard. A numerical experiment is conducted in MATLAB and PSG environment and the result proves the correctness of our work as well as the improvement of the computational efficiency. Start by int roducing the optimal execution problem, we compared the traditional models and the sample path based stochastic model invented by Krokhmal and Uryasev (2007). Two important features of the sample path model are to incorporate historical data for specific f inancial instrument and the convenience to impose risk constraints. These two features make the sample path model flexible to be customized by investors with different utilities and, more importantly, to be more trustworthy to solve problems in real world. Finally, we discuss the possible extensions to apply our model in more complex situations in the future. 5.1 Computational Efficiency We compare the two formulations in terms of their problem size and numerical results in the frictionless market with no r isk constraints. PAGE 40 40 Figure 5 1. Solving Time for Problem 1 and 2 From Figure 5 1, it is clear that the solving time increase linearly to the number of sample paths for Problem 1. With the same group number, the solving time for Problem 2 stay in a low leve l for increasing sample size. To better understand the difference in the structure of two formulations, we prepare the table as follows: Table 5 1. Size s of Problem 1 and Problem 2 Problem Datasets Number of Scenarios Number of Variables Solving Time (s) Problem 1 Problem 2 Problem 1 Problem 2 Problem 1 Problem 2 Dataset 1 (J=10, K=5) 10 10 75 25 <0.01 <0.01 Dataset 2 (J=100, K=10) 100 100 550 50 0.05 0.02 Dataset 3 (J=1000, K=10) 1000 1000 5050 50 3.99 0.05 Dataset 4 (J=2000, K=10) 2000 2000 10050 50 24.54 0.12 For both problems the number of scenarios is the same and equals to the number of sample paths. The difference comes from the number of decision variables, which equals to for problem 1 and for Problem 2. The difference is huge 0 5 10 15 20 25 30 Dataset 1 (J=10, K=5) Dataset 2 (J=100, K=10) Dataset 3 (J=1000, K=10) Dataset 4 (J=2000, K=10) Solving time (s) Problem 1 Problem 2 PAGE 41 41 when the number of scenarios is much greater than the number of groups. For example, in D ataset 4 where J=2000 and K= 10, the n umber of decision variables in P roblem 1 is 2000 time s more than t hat in P roblem 2. As we have discussed in Chapter 3 and Chapter 4, for the optimal execution problem, it is always reasonable to keep K small (less than 50) to circumvent anticipativity. The selection of the sample size has no such limitations. To some ext ent, people may feel more reliable of the model with larger size of sample paths. 5.2 Future Work In Chapter 3, we have proposed two general formulations for optimal execution with any form of price impact function and risk constraints. Because of the lim itation of time and the appropriate functions in PSG, we only solve the most simplified problem in frictionless market in Chapter 4. For short term, we plan to design several functions in PSG for solving optimal execution problem under linear temporary an d permanent market impact. Since the objective is quadratic, those functions need to take the maximum and to build a quadratic function from the input matrix. Credit risk has been intensively investigated by researchers since the occurren ce of financial cr isis in 2008. The impact of credit risk can be incorporated in our model by changing of the shape of the ma rket impact function. In practice, a financial instrument is evaluated by big three credit rating companies and be classified into different grades. Influenced by credit risk, some instruments may be smoot s h to trade for normal sizes, but it will become very difficult or simply impossible to trade when the trading size is larger than a threshold, i.e. the liquidity disappears for some extreme cases. We can PAGE 42 42 simulate the dynamics by utilizing a piecewise function to simulate the discrete feature of the market impact. Another modification for the market impact function is to use specific nonlinear functions to describe the price slippage. The function shou ld be built on the analysis on the background and historical performance of certain financial instrument. On the other hand, the function should be built such that the objective function is a concave shape that can be maximized efficiently by convex progra mming solvers. The ultimate goal of this problem is to design a computerized algorithmic trading system to enable automatic trade executions. To achieve this goal, we should also solve the problem for portfolios with multiple assets. Some interactions must be formulated in forms of interacting market impact in the objective and covariance matrices in risk constraints. More importantly, the system still needs to be tested by large number of historical data to validate the stability and reliability before put ting into practice. The models and algorithms we present in this thesis can serve as a starting point in the field of sample path based optimal execution problem. PAGE 43 43 APPENDIX A PROBLEM STATEMENT FOR PSG RUN FILE Problem 1 problem: problem_optimal_execution_ave, type = maximize objective: objective_ave avg_g_obj_ave(pmatrix_obj) constraint: constraint_nonadditive,linearize=1, upper_bound = 0 max_risk_constraint1(pmatrix_constraint1) constraint: constraint_monotonic,linearize=1, upper _bound = 0 max_risk_constraint2(pmatrix_constraint2) box_of_variables: lowerbounds = 0, upperbounds = 1 Solver: CAR, precision = 6, stages = 6 Problem 2 problem: problem_optimal_execution, type = maximize objective: objective_avg_risk avg_max_risk_g_obj(p matrix_obj_1,pmatrix_obj_2, pmatrix_obj_3,pmatrix_obj_4,pmatrix_obj_5) box_of_variables: lowerbounds = 0, upperbounds = 1 Solver: VAN, precision = 9, stages = 6 Problem 3 problem: problem_optimal_execution_cvar_risk, type = maximize objective: objective_av e avg_matrix_obj_avg(pmatrix_obj) constraint: constraint_risk, linearize = 1, upper_bound = 0.93 PAGE 44 44 cvar_risk_obj_ave(0.9,pmatrix_obj) constraint: constraint_nonadditive,linearize = 1, upper_bound = 0 max_risk_constraint1(pmatrix_constraint1) constraint: constraint_monotonic,Linearize = 1, upper_bound = 0 max_risk_constraint2(pmatrix_constraint2) box_of_variables: lowerbounds = 0, upperbounds = 1 Solver: CAR, precision = 4, stages = 6 Problem PAGE 45 45 APPENDIX B MATLAB SCRIPT TO GENERATE INPUT MATRICES Matrices Generating Script for problem 1 and 3 clear; clc; %Assign the number of groups K: K = 10; J = 2000; path = importdata('sample_paths.txt'); matrix_path = path.data(1:1:J,:); header = path.textdata; %get the values of num ber of paths and the number of time periods. [JJ,T] = size(matrix_path); %Get the grouping matrix of every prices on path j [matrix_path_sorted,IX] = sort(matrix_path); for tt = 1:1:T for jj = 1:1:J IXX(IX(jj,tt),tt) = jj; end end matrix_k = ceil(IXX./(J/K)); %Print the matrix in the file and save it in vector_obj %Generate the matrix in objective clear j; PAGE 46 46 clear t; fid = fopen('pmatrix_obj.txt','w'); %Print the header of the file matrix_obj = zeros(J,J*T+K*T+2); for j = 1:1:J k = matrix _k(j,1); matrix_obj(j,T*J+K*T+1) = 1/J; matrix_obj(j,T*J+K*T+2) = matrix_path(j,1); matrix_obj(j,T*J+T*(k 1)+1) = matrix_path(j,1); for t = 2:1:T k = matrix_k(j,t); matrix_obj(j,T*(j 1)+t 1) = matrix_path(j,t); mat rix_obj(j,T*J+T*(k 1)+t) = matrix_path(j,t); end end print_pmatrix(fid,matrix_obj,J,T,K); fclose('all'); clear j; clear t; clear pmatrix_constraint1; %Prepare the matrix used in the nonanticipativity constraint, here %called consraint1. pmatrix_constraint1 = zeros(J*T*2,3); PAGE 47 47 fid = fopen('pmatrix_constraint1.txt','w'); %Print the header of the pmatrix file for j = 1:1:J for t = 1:1:T fprintf(fid,'xi%d_%d \ t',j,t); end end for k = 1:1:K for t = 1:1:T fprintf(fid,'x%d_%d \ t', k, t); end end fprintf(fid,' \ r \ n'); %Print the values of matrix and store the data in pmatrix_constraint1 for j = 1:1:J for t = 1:1:T pmatrix_constraint1(2*T*(j 1)+2*(t 1)+1,1) = T*(j 1)+t; pmatrix_constraint1(2*T*(j 1)+2*(t 1)+1,2) = T*(j 1)+t; pmatrix_constraint1(2*T*(j 1)+2*(t 1)+1,3) = 1; fprintf(fid,'%d \ t%d \ t%d \ r \ n',T*(j 1)+t,T*(j 1)+t, 1); pmatrix_constraint1(2*T*(j 1)+2*(t 1)+2,1) = T*(j 1)+t; pmatrix_constraint1(2*T*(j 1)+2*(t 1)+2,2) = T*J+T*(mat rix_k(j,t) 1)+t; pmatrix_constraint1(2*T*(j 1)+2*(t 1)+2,3) = 1; PAGE 48 48 fprintf(fid,'%d \ t%d \ t%d \ r \ n',T*(j 1)+t,T*J+T*(matrix_k(j,t) 1)+t,1); end end fclose('all'); %Prepare the matrix used in the monotonicity constraint, here called %constraint2 fid2 = fopen('pmatrix_constraint2.txt','w'); for j = 1:1:J for t = 1:1:T fprintf(fid2,'xi%d_%d \ t',j,t); end end for k = 1:1:K for t = 1:1:T fprintf(fid2,'x%d_%d \ t', k,t); end end fprintf(fid2,' \ r \ n'); %Calculate the values in the matrix. clear i; clear ii; i = 1; ii = 1; PAGE 49 49 for j = 1:1:J for t = 1:1:T if (t == T) i=i+2; else pmatrix_constraint3(2*T*(j 1)+2*(t 1)+1,1) = T*(j 1)+t; pmatrix_constraint3(2*T*(j 1)+2*(t 1)+1,2) = T*(j 1)+t; pmatrix_constraint3(2*T*(j 1)+2*(t 1)+1,3) = 1; fprintf(fid2,'%d \ t%d \ t%d \ r \ n',ii,T*(j 1)+t,1); pmatrix_constraint3(2*T*(j 1)+2*(t 1)+2,1) = T*(j 1)+t; pmatrix_constraint3( 2*T*(j 1)+2*(t 1)+2,2) = T*(j 1)+t+1; pmatrix_constraint3(2*T*(j 1)+2*(t 1)+2,3) = 1; fprintf(fid2,'%d \ t%d \ t%d \ r \ n',ii,T*(j 1)+t+1, 1); ii = ii+1; end end end fclose('all'); Matrices Generating Script for P roblem 2 clear; clc; %Assign the number of groups K: K = 10; JJ = 4000; PAGE 50 50 path = importdata('sample_paths.txt'); matrix_path = path.data(1:1:JJ,:); header = path.textdata; %get the values of number of paths and the number of time periods. [J,T] = size(matrix _path); %Get the grouping matrix of every prices on path j [matrix_path_sorted,IX] = sort(matrix_path); for tt = 1:1:T for jj = 1:1:J IXX(IX(jj,tt),tt) = jj; end end matrix_k = ceil(IXX./(J/K)); %Initialization of matrix_obj(i,:,:) matrix_obj =zeros(T,J*T,K*T+2); for jt = 1:1:J*T j = ceil(jt/T); t = jt (j 1)*T; k = matrix_k(j,t); matrix_obj(1,jt,(k 1)*T+t) = T*matrix_path(j,t); matrix_obj(1,jt,K*T+1) = 1/(J*T); matrix_obj(1,jt,K*T+2) = T*matrix_path(j,t); end PAGE 51 51 for tau = 2:1:T tau1 = tau 1; for jt = 1:1:J*T matrix_obj(tau,jt,K*T+1) = 1/(J*T); j = ceil(jt/T); t = jt (j 1)*T; kt = matrix_k(j,t); ktau1 = matrix_k(j,tau1); if (tau 1 < t) matrix_ obj(tau,jt,(kt 1)*T+t) = T*matrix_path(j,t); matrix_obj(tau,jt,T*(ktau1 1)+tau1) = T*matrix_path(j,t); else matrix_obj(tau,jt,K*T+2) = T*matrix_path(j,t); end end end fid(1) = fopen('pmatrix_o bj_1.txt','w'); fid(2) = fopen('pmatrix_obj_2.txt','w'); fid(3) = fopen('pmatrix_obj_3.txt','w'); fid(4) = fopen('pmatrix_obj_4.txt','w'); fid(5) = fopen('pmatrix_obj_5.txt','w'); matrix_1(:,:) = matrix_obj(1,:,:); matrix_2(:,:)= matrix_obj(2,:,:); PAGE 52 52 matrix_ 3(:,:)= matrix_obj(3,:,:); matrix_4(:,:)= matrix_obj(4,:,:); matrix_5(:,:)= matrix_obj(5,:,:); print_pmatrix(fid(1),matrix_1,J,T,K); print_pmatrix(fid(2),matrix_2,J,T,K); print_pmatrix(fid(3),matrix_3,J,T,K); print_pmatrix(fid(4),matrix_4,J,T,K); print_pma trix(fid(5),matrix_5,J,T,K); fclose('all'); Function to Print Data into Packed Matrices function print_pmatrix(fid,matrix,J,T,K) %print header of the txt file: for k = 1:1:K for t = 1:1:T fprintf(fid,'x%d_%d \ t', k,t); end end fprintf(fid,'scena rio_probability \ t'); fprintf(fid,'scenario_benchmark'); fprintf(fid,' \ r \ n'); %Start printing the value in the matrix: for j = 1:1:J*T for i = 1:1:K*T+2 if matrix(j,i) == 0 PAGE 53 53 else fprintf(fid,'%d \ t%d \ t%f \ r \ n',j,i,matrix(j,i)); end end end Function to Print Data into Full Matrices function print_pmatrix(fid,matrix,J,T,K) %print header of the txt file: for j = 1:1:J for t = 1:1:T fprintf(fid,'xi%d_%d \ t', j,t); end end for k = 1:1:K for t = 1:1:T fpr intf(fid,'x%d_%d \ t', k,t); end end fprintf(fid,'scenario_probability \ t'); fprintf(fid,'scenario_benchmark'); fprintf(fid,' \ r \ n'); %Start printing the value in the matrix: for j = 1:1:J for i = 1:1:J*T+K*T+2 PAGE 54 54 fprintf(fid,'%f \ t',matrix(j,i)); end fprintf(fid,' \ r \ n'); end end PAGE 55 55 LIST OF REFERENCES AitSahlia, F., Sheu, Y., & Pardalos, P. M. (2008). In Kontoghiorghes E. J., Rustem B. and Winker P.(Eds.), Optimal execution of time constrained portfolio transactions Springer Berlin Heidelberg. doi:10.1007/978 3 540 77958 2_5 Almgren, R. (2001). Optimal execution of portfolio transactions. The Journal of Risk, 3, 5. Almgren, R. F. (2 003). Optimal execution with nonlinear impact functions and trading enhanced risk. Applied Mathematical Finance, 10(1), 1. Retrieved from https://search.ebscohost.com/login.aspx?direct=true&db=buh&AN=9756597&site= ehost live Almgren, R. (2007). Adaptive ar rival price. Trading, 2007(1), 59. Bertimas, D., Lo, A. W., & Hummel, P. (1999). Optimal control of execution costs for portfolios. Computing in Science & Engineering, 1(6), 40 53. Birge, J. R., & Louveaux, F. (1997). Introduction to stochastic programmi ng. New York: Springer. Khemchandani, R. R. (2012). Optimal execution with weighted impact functions: A quadratic programming approach. Optimization Letters, Kissell, R. R. (2006). Algorithmic decision making framework. Journal of Trading, 1(1), 12 21. K issell, R., Glantz, M., & Malamut, R.,. (2003). Optimal trading strategies : Quantitative approaches for managing market impact and trading risk. New York: AMACOM. Krokhmal, P., & Uryasev, S. (2007). A sample path approach to optimal position liquidation S pringer Netherlands. doi:10.1007/s10479 006 0143 3 Mathematical Finance., 18(5), 395 422. Perold, A. A. F. (1988). The implementation shortfall paper versus reality. Journal of Port folio Management, 14(3), 4 9. Rockafellar, R. T., & Uryasev, S. (2002). Conditional value at risk for general loss distributions. Journal of Banking & Finance, 26(7), 1443 1471. doi:10.1016/S0378 4266(02)00271 6 PAGE 56 56 BIOGRAPHICAL SKETCH Suiyi Su, bo from Xifei No.1 Senior Middle School. As a highly motivated individual, he attended Beihang University in Beiijng, China in 2006. During his four years in Beihang University, he has been Engineering and the monitor of Class 2006. In recognition of his hard working, he has be en awarded by several prizes for excellent academic performance and contribution to the school as well as the Beihang University. He received his majoring in automation e ngineering in July, 2010 With the support from family and his strong determination to study abroad, he applied to several top graduate programs in the United States of America He decided to join in the Department of Industrial and Systems Engineering at the University of Florida with the Achievement Award soon after his graduation from undergraduate study During the two year study at the University of Florida, he found himself attracted by the theory and application of operations research and quantitative f inance. After thesis. With the purp ose to apply the knowledge he learned from class, he focused on the study of optimal trading execution problem under the guidance of Dr. Stan Uryasev and Dr. Guanghui Lan. After he graduates in August 2012, he will make a decision between to continue his P hD study at the University of Florida or join the industry and start his life as a n operation researcher in the area of energy optimization. 