# BA 452 Lesson B.6 Nonlinear Programming 1 11 1 1 11 1ReadingsReadings Chapter 8 Nonlinear Optimization Models.

## Presentation on theme: "BA 452 Lesson B.6 Nonlinear Programming 1 11 1 1 11 1ReadingsReadings Chapter 8 Nonlinear Optimization Models."— Presentation transcript:

BA 452 Lesson B.6 Nonlinear Programming 1 11 1 1 11 1ReadingsReadings Chapter 8 Nonlinear Optimization Models

BA 452 Lesson B.6 Nonlinear Programming 2 22 2 2 22 2OverviewOverview

3 33 3 3 33 3Overview Local and Global Optima of nonlinear programming problems are the optimal solutions either over a neighborhood of the feasible set (local), or over the entire feasible set (global). Approximation Errors are typically measured as the sum of squares of the differences between desired values and actual values, such as the difference between an Index Fund and the S&P 500. Nonlinear Assignment Problems are assignment problems where the objective is nonlinear. For example, minimizing the distance times weight of cargo assigned to loading docks. Variance of an investment portfolio is measured as the expected value of the sum of squares of the differences between expected rates of return and actual rates of return. Semi Variance of an investment portfolio modifies Variance by measuring only the times when actual rates of return fall short of expected rates of return. Those are the bad unexpected differences.

BA 452 Lesson B.6 Nonlinear Programming 4 44 4 4 44 4 Tool Summary n Distinguish between a local optimum and a global optimum. The former is an optimum only in the immediate neighborhood, and the latter is an optimum in the entire feasible region. n Know that the product of two binary variables is, itself, a binary variable. And the product is 1 if, and only if, each separate binary variable is 1. Thus if x is a binary variable that is 1 when you mow the yard and y is a binary variable that is 1 when you wash the car, the product of x and y is 1 when you mow the yard and wash the car. Overview

BA 452 Lesson B.6 Nonlinear Programming 5 55 5 5 55 5 Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 6 66 6 6 66 6 Overview Local and Global Optima of nonlinear programming problems are the optimal solutions either over a neighborhood of the feasible set (local), or over the entire feasible set (global). Because it is so hard for a computer program to solve some nonlinear programs, you need not compute any solutions. Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 7 77 7 7 77 7 Nonlinear optimization problems are those optimization problems in which at least one term in the objective function or a constraint is nonlinear. Nonlinear terms include Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 8 88 8 8 88 8 n A feasible solution is a local optimum if there are no other feasible solutions with a better objective function value in the immediate neighborhood. For a maximization problem the local optimum corresponds to a local maximum. For a maximization problem the local optimum corresponds to a local maximum. For a minimization problem the local optimum corresponds to a local minimum. For a minimization problem the local optimum corresponds to a local minimum.  A feasible solution is a global optimum if there are no other feasible points with a better objective function value in the feasible region.  Obviously, a global optimum is also a local optimum. Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 9 99 9 9 99 9 n Nonlinear optimization problems can have multiple local optimal solutions, in which case we want to find the best local optimum. n Nonlinear problems with multiple local optima are difficult to solve with optimization software. n In these cases, the software can get “stuck” and terminate at a local optimum. n There can be a severe penalty (loss of objective) for confusing a local optimum for a global optimum. n Developing software to find global optima is an active research area. Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 10 n Consider the function n The shape of this function is shown on the next slide. n The hills and valleys in the graph show that this function has several local maximums and local minimums. n There are three local maximums, one of which is the global maximum. Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 11 Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 12 n Consider the function n The shape of this function is shown on the next slide. n A function that is bowl-shaped down is called a concave function. n The maximum value for this particular function is 0 and the point (0, 0) gives the optimal value of 0. n Functions such as this one have a single local maximum that is also a global maximum. n A nonlinear problem with that type of objective function is relatively easy to maximize. Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 13 Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 14 n Consider the function n The shape of this function is shown on the next slide. n A function that is bowl-shaped up is called a convex function. n The minimum value for this particular function is 0 and the point (0, 0) gives the optimal value of 0. n Functions such as this one have a single local minimum that is also a global minimum. n This type of nonlinear problem is relatively easy to minimize. Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 15 Y X Z 2 4 0 -2 -4 -2 0 2 4 40 20 Local and Global Optima

BA 452 Lesson B.6 Nonlinear Programming 16 Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 17 Overview Approximation Errors are typically measured as the sum of squares of the differences between predicted or desired values and actual values, such as the difference between the returns on an Index Fund and the past performance of a broad market index, such as the S&P 500. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 18 n Index funds are a very popular investment vehicle in the mutual fund industry. n Vanguard 500 Index Fund is the largest mutual fund in the U.S. with over \$70 billion in net assets in 2005. n An index fund is an example of passive asset management, which emphasizes past performance. n The key idea behind an index fund is to construct a portfolio of stocks, mutual funds, or other securities that closely matches the past performance of a broad market index such as the S&P 500. n Behind the popularity of index funds is research that basically says “you can’t beat the market”. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 19 Question: Lymann Brothers has a substantial number of clientswho wish to own a mutual fund portfolio that closely matches the performance of the S&P 500 stock index. A manager at Lymann Brothers has selected five mutual funds (shown on the next slide) that will be considered for inclusion in the portfolio. The manager must decide what percentage of the portfolio should be invested in each mutual fund. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 20 Annual Returns (Planning Scenarios) Annual Returns (Planning Scenarios) Mutual Fund Year 1Year 2Year 3Year 4 International Stock 25.64 27.62 5.80 -3.13 Large-Cap Blend 15.31 18.77 11.06 4.75 Mid-Cap Blend 18.74 18.43 6.28 -1.04 Small-Cap Blend 14.19 12.37 -1.92 7.32 Intermediate Bond 7.88 9.45 10.56 3.31 S&P 500 13.00 12.00 7.00 2.00 n Mutual Fund Performance in 4 Selected Years Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 21 Formulate and solve a non-linear programming problem to determine what percentage of the portfolio should be invested in each mutual fund so that the portfolio closely matches the performance of the S&P 500 stock index. Use the sum of squared deviations to measure the closeness of the portfolio to the index. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 22 Answer: Define the 9 Decision Variables IS = proportion of portfolio invested in international stock LC = proportion of portfolio invested in large-cap blend MC = proportion of portfolio invested in mid-cap blend SC = proportion of portfolio invested in small-cap blend IB = proportion of portfolio invested in intermediate bond R1 = portfolio return for scenario 1 (year 1) R2 = portfolio return for scenario 2 (year 2) R3 = portfolio return for scenario 3 (year 3) R4 = portfolio return for scenario 4 (year 4) Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 23 n Define the objective function Min (R1 – 13) 2 + (R2 – 12) 2 + (R3 – 7) 2 + (R4 – 2) 2 n Define the constraints (including non-negativity) 25.64IS + 15.31LC + 18.74MC + 14.19SC + 7.88IB = R1 27.62IS + 18.77LC + 18.43MC + 12.37SC + 9.45IB = R2 5.80IS + 11.06LC + 6.28MC - 1.92SC + 10.56IB = R3 5.80IS + 11.06LC + 6.28MC - 1.92SC + 10.56IB = R3 - 3.13IS + 4.75LC - 1.04MC + 7.32SC + 3.31IB = R4 - 3.13IS + 4.75LC - 1.04MC + 7.32SC + 3.31IB = R4 IS + LC + MC + SC + IB = 1 IS, LC, MC, SC, IB > 0 Fund Year 1 Year 2 Year 3 Year 4 IS 25.64 27.62 5.80 -3.13 LC 15.31 18.77 11.06 4.75 MC 18.74 18.43 6.28 -1.04 SC 14.19 12.37 -1.92 7.32 IB 7.88 9.45 10.56 3.31 SP 13.00 12.00 7.00 2.00 Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 24 n Optimal Solution for Lymann Brothers Example R1 = 12.51(12.51% portfolio return for scenario 1)R1 = 12.51(12.51% portfolio return for scenario 1) R2 = 12.90 (12.90% portfolio return for scenario 2)R2 = 12.90 (12.90% portfolio return for scenario 2) R3 = 7.13 ( 7.13% portfolio return for scenario 3)R3 = 7.13 ( 7.13% portfolio return for scenario 3) R4 = 2.51 ( 2.51% portfolio return for scenario 4)R4 = 2.51 ( 2.51% portfolio return for scenario 4) IS = 0 ( 0.0% of portfolio in international stock)IS = 0 ( 0.0% of portfolio in international stock) LC = 0 ( 0.0% of portfolio in large-cap blend)LC = 0 ( 0.0% of portfolio in large-cap blend) MC =.332 (33.2% of portfolio in mid-cap blend)MC =.332 (33.2% of portfolio in mid-cap blend) SC =.161 (16.1% of portfolio in small-cap blend)SC =.161 (16.1% of portfolio in small-cap blend) IB =.507 (50.7% of portfolio in intermediate bond)IB =.507 (50.7% of portfolio in intermediate bond) n Lymann Brothers Portfolio Return vs. S&P 500 Return Scenario Portfolio ReturnS&P 500 Return 112.5113.00 112.5113.00 2 12.9012.00 2 12.9012.00 3 7.13 7.00 3 7.13 7.00 4 2.51 2.00 4 2.51 2.00 Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 25 Nonlinear Assignment

BA 452 Lesson B.6 Nonlinear Programming 26 Nonlinear Assignment Overview Nonlinear Assignment Problems are assignment problems where the objective is nonlinear. For example, minimizing the distance times weight of cargo assigned to loading docks.

BA 452 Lesson B.6 Nonlinear Programming 27 Nonlinear Assignment n The port of Long Beach has three available loading docks. The distance (in meters) between the loading docks is giving in the table below: 1 2 3 1 2 3 1 | 0 100 150 1 | 0 100 150 2 | 100 0 50 2 | 100 0 50 3 | 150 50 0 3 | 150 50 0 n Three tankers currently at sea are coming into Long Beach. Each tanker needs its own dock. Currently tankers 2 and 3 are empty. Tanker 1 has cargo that must be loaded onto the other tankers: 60 tons to Tanker 2 and 80 tons to Tanker 3. n Formulate then solve a non-linear programming problem to minimize the product of tonnage times distance, added across all tankers.

BA 452 Lesson B.6 Nonlinear Programming 28 n This is an extension of the assignment problems considered earlier. Like assigning “agents” to “tasks”, now assign tankers to docks. n Using standard notation for an assignment problem, let XIJ = 1 if Tanker I is assigned to Dock J, and 0 if not. n The constraints are just like the standard assignment problems. ! Each tanker must be assigned to a dock; X11 + X12 + X13 = 1; !Tanker 1; X21 + X22 + X23 = 1; !Tanker 2; X31 + X32 + X33 = 1; !Tanker 3; ! Each dock can be assigned to at most one tanker; X11 + X21 + X31 < 1; !Dock 1; X12 + X22 + X32 < 1; !Dock 2; X13 + X23 + X33 < 1; !Dock 3; Nonlinear Assignment

BA 452 Lesson B.6 Nonlinear Programming 29 n The difference from the standard assignment problem is the objective function is now nonlinear. The reason is the cost of assigning Tanker I to Dock J is no longer constant. For example, the cost of assigning Tanker 3 to Dock J depends on where Tanker 1 is assigned, because that assignment affects how far the 80 tons of cargo must move from Tanker 1 to Tanker 3. n For example, consider the result of assigning Tanker 1 to Dock 2 and Tanker 3 to Dock 1. n The distance between loading Docks 1 and 2 is 100 meters. And Tanker 1 must transfer 80 tons of goods to Tanker 3. This means that 80 tons must be moved 100 meters. To capture that in the objective function, write 100*80*X12*X31. Since both X12 = 1 and X31 = 1 their product is 1, and the product of distance and tonnage moved (100*80) is the term 100*80*X12*X31. Nonlinear Assignment

BA 452 Lesson B.6 Nonlinear Programming 30 n The complete objective function is MIN = 100*60*X11*X22 + 150*60*X11*X23 MIN = 100*60*X11*X22 + 150*60*X11*X23 + 100*60*X12*X21 + 50*60*X12*X23 + 150*60*X13*X21 + 50*60*X13*X22 ! Those are the costs of moving 60 tons from Tanker 1 to 2; + 100*80*X11*X32 + 150*80*X11*X33 + 100*80*X12*X31 + 50*80*X12*X33 + 150*80*X13*X31 + 50*80*X13*X32; ! Those are the costs of moving 80 tons from Tanker 1 to 3; n For example, compute the cost of assigning Tanker 1 to Dock 2, Tanker 2 to Dock 3, and Tanker 3 to Dock 1. n Variables are X12 = X23 = X31 = 1, with all other XIJ = 0. n The objective function is then 100*60*0*0 + 150*60*0*1 + 100*60*1*0 + 50*60*1*1 + … = 50*60 + 100*80 = 11,000 Nonlinear Assignment

BA 452 Lesson B.6 Nonlinear Programming 31 @BIN(X33); specifies X33 as a binary variable Optimal assignment: n Tanker 1 to Dock 2 n Tanker 2 to Dock 1 n Tanker 3 to Dock 3 Nonlinear Assignment

BA 452 Lesson B.6 Nonlinear Programming 32 VarianceVariance

BA 452 Lesson B.6 Nonlinear Programming 33 Overview Variance of an investment portfolio is measured as the expected value of the sum of squares of the differences between expected rates of return and actual rates of return. Variance

BA 452 Lesson B.6 Nonlinear Programming 34 n The key tradeoff in most portfolio optimization models is between risk and return. n The index fund model (Lymann Brothers example) presented earlier managed the tradeoff passively (ex post, or after the fact). n The Markowitz mean-varianceportfolio model provides a very convenient way for an investor to trade off risk versus return actively (ex ante, or before the fact). n We demonstrate the Markowitz portfolio model by extending the Lymann Brothers example. Variance

BA 452 Lesson B.6 Nonlinear Programming 35 n In the Lymann Brothers example there were four scenarios and the return under each scenario was defined by the variables R1, R2, R3, and R4. n If p s is the probability of scenario s, and there are n scenarios, then the expected return for the portfolio R is n If we assume that the four scenarios in the Lymann Brothers model are equally likely, then Variance

BA 452 Lesson B.6 Nonlinear Programming 36 n The measure of risk most often associated with the Markowitz model is the variance of the portfolio. n For our example, the portfolio variance is n For our example, the four planning scenarios are equally likely. Thus, Variance

BA 452 Lesson B.6 Nonlinear Programming 37 n The portfolio variance is the average of the sum of the squares of the deviations from the mean value under each scenario. n The larger the variance value, the more widely dispersed the scenario returns are around the average return value. n If the portfolio variance equaled zero, then every scenario return R i would have to equal. Variance

BA 452 Lesson B.6 Nonlinear Programming 38 n There are two alternative ways to formulate the Markowitz model: (1) Minimize the variance of the portfolio subject to constraints on the expected return, and(1) Minimize the variance of the portfolio subject to constraints on the expected return, and (2) Maximize the expected return of the portfolio subject to a constraint on risk (we did that in a previous lesson).(2) Maximize the expected return of the portfolio subject to a constraint on risk (we did that in a previous lesson). We demonstrate the first (1) formulation, assuming that Lymann Brothers’ client requires the expected portfolio return to be at least 9 percent. We demonstrate the first (1) formulation, assuming that Lymann Brothers’ client requires the expected portfolio return to be at least 9 percent.Variance

BA 452 Lesson B.6 Nonlinear Programming 39 Question: Lymann Brothers has a substantial number of clientswho wish to own a mutual fund portfolio with minimum variance and an expected return on 9 percent. A manager at Lymann Brothers has selected five mutual funds (shown on the next slide) that will be considered for inclusion in the portfolio. The manager must decide what percentage of the portfolio should be invested in each mutual fund. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 40 Annual Returns (Planning Scenarios) Annual Returns (Planning Scenarios) Mutual Fund Year 1Year 2Year 3Year 4 International Stock 25.64 27.62 5.80 -3.13 Large-Cap Blend 15.31 18.77 11.06 4.75 Mid-Cap Blend 18.74 18.43 6.28 -1.04 Small-Cap Blend 14.19 12.37 -1.92 7.32 Intermediate Bond 7.88 9.45 10.56 3.31 n Mutual Fund Performance in 4 Selected Years Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 41 Formulate and solve a non-linear programming problem to determine what percentage of the portfolio should be invested in each mutual fund so that the portfolio has minimum variance and an expected return of 9 percent. Assume all scenarios are equally likely. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 42 Answer: Define the 9 Decision Variables IS = proportion of portfolio invested in international stock LC = proportion of portfolio invested in large-cap blend MC = proportion of portfolio invested in mid-cap blend SC = proportion of portfolio invested in small-cap blend IB = proportion of portfolio invested in intermediate bond R1 = portfolio return for scenario 1 (year 1) R2 = portfolio return for scenario 2 (year 2) R3 = portfolio return for scenario 3 (year 3) R4 = portfolio return for scenario 4 (year 4) Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 43 n Define the Objective Function Minimize the portfolio variance: Minimize the portfolio variance: n Constrain the return for each scenario: each scenario: 25.64IS + 15.31LC + 18.74MC + 14.19SC + 7.88IB = R1 27.62IS + 18.77LC + 18.43MC + 12.37SC + 9.45IB = R2 5.80IS + 11.06LC + 6.28MC  1.92SC + 10.56IB = R3 5.80IS + 11.06LC + 6.28MC  1.92SC + 10.56IB = R3  3.13IS + 4.75LC  1.04MC + 7.32SC + 3.31IB = R4  3.13IS + 4.75LC  1.04MC + 7.32SC + 3.31IB = R4 Fund Year 1 Year 2 Year 3 Year 4 IS 25.64 27.62 5.80 -3.13 LC 15.31 18.77 11.06 4.75 MC 18.74 18.43 6.28 -1.04 SC 14.19 12.37 -1.92 7.32 IB 7.88 9.45 10.56 3.31 Variance

BA 452 Lesson B.6 Nonlinear Programming 44 n Constrain that all money be invested: IS + LC + MC + SC + IB = 1 IS + LC + MC + SC + IB = 1 n Define the expected return for the portfolio: n Constrain the expected portfolio return to be at least 9 percent: n Constrain non-negativity: IS, LC, MC, SC, IB > 0 Variance

BA 452 Lesson B.6 Nonlinear Programming 45 n Optimal Solution R1 = 10.63% portfolio return for scenario 1R1 = 10.63% portfolio return for scenario 1 R2 = 12.20% portfolio return for scenario 2R2 = 12.20% portfolio return for scenario 2 R3 = 8.93% portfolio return for scenario 3R3 = 8.93% portfolio return for scenario 3 R4 = 4.24% portfolio return for scenario 4R4 = 4.24% portfolio return for scenario 4 Rbar = 9.00% expected portfolio returnRbar = 9.00% expected portfolio return IS = 0.00% of portfolio in international stockIS = 0.00% of portfolio in international stock LC = 25.10% of portfolio in large-cap blendLC = 25.10% of portfolio in large-cap blend MC = 0.00%of portfolio in mid-cap blendMC = 0.00%of portfolio in mid-cap blend SC = 14.1% of portfolio in small-cap blendSC = 14.1% of portfolio in small-cap blend IB = 60.8% of portfolio in intermediate bondIB = 60.8% of portfolio in intermediate bond 100.0% of portfolio Variance

BA 452 Lesson B.6 Nonlinear Programming 46 Semi Variance

BA 452 Lesson B.6 Nonlinear Programming 47 Overview Semi Variance of an investment portfolio modifies Variance by measuring only the times when actual rates of return fall short of expected rates of return. Those are the times when unexpected returns are bad.. Semi Variance

BA 452 Lesson B.6 Nonlinear Programming 48 n Most investors are happy when their returns are above average, but want to avoid returns below average. n In the previous Markowitz porfolio optimization problem, we minimized variance, which is the sum of squares of the deviations from the mean. n Now change the objective to minimize the semi- variance, which is the sum of squares of those deviations from the mean that are below the mean. Semi Variance

BA 452 Lesson B.6 Nonlinear Programming 49 n As before, constrain the return for each scenario: for each scenario: 25.64IS + 15.31LC + 18.74MC + 14.19SC + 7.88IB = R1 27.62IS + 18.77LC + 18.43MC + 12.37SC + 9.45IB = R2 5.80IS + 11.06LC + 6.28MC  1.92SC + 10.56IB = R3 5.80IS + 11.06LC + 6.28MC  1.92SC + 10.56IB = R3  3.13IS + 4.75LC  1.04MC + 7.32SC + 3.31IB = R4 n Then, define and constrain the expected return for the portfolio: Fund Year 1 Year 2 Year 3 Year 4 IS 25.64 27.62 5.80 -3.13 LC 15.31 18.77 11.06 4.75 MC 18.74 18.43 6.28 -1.04 SC 14.19 12.37 -1.92 7.32 IB 7.88 9.45 10.56 3.31 SP 13.00 12.00 7.00 2.00 Semi Variance

BA 452 Lesson B.6 Nonlinear Programming 50 n But instead of minimizing the variance n Decompose deviations into positive or negative terms R1 - Rbar = DP1 – DN1, R2 - Rbar = DP2 – DN2, R3 - Rbar = DP3 – DN3, R4 - Rbar = DP4 – DN4. n Then minimize the sum of the squares of the negative deviations, which is the semi-variance. Semi Variance

BA 452 Lesson B.6 Nonlinear Programming 51 Question: Lymann Brothers has a substantial number of clientswho wish to own a mutual fund portfolio with minimum semivariance and an expected return on 9 percent. A manager at Lymann Brothers has selected five mutual funds (shown on the next slide) that will be considered for inclusion in the portfolio. The manager must decide what percentage of the portfolio should be invested in each mutual fund. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 52 Annual Returns (Planning Scenarios) Annual Returns (Planning Scenarios) Mutual Fund Year 1Year 2Year 3Year 4 International Stock 25.64 27.62 5.80 -3.13 Large-Cap Blend 15.31 18.77 11.06 4.75 Mid-Cap Blend 18.74 18.43 6.28 -1.04 Small-Cap Blend 14.19 12.37 -1.92 7.32 Intermediate Bond 7.88 9.45 10.56 3.31 n Mutual Fund Performance in 4 Selected Years Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 53 Formulate and solve a non-linear programming problem to determine what percentage of the portfolio should be invested in each mutual fund so that the portfolio has minimum semivariance and an expected return of 9 percent. Assume all scenarios are equally likely. Approximation Errors

BA 452 Lesson B.6 Nonlinear Programming 54 Semi Variance Answer:

BA 452 Lesson B.6 Nonlinear Programming 55 n As an error check, make sure that, for each variable, either DPi = 0 or DNi = 0. n DN1 = DN2 = 0. n DP3 = DP4 = 0. Semi Variance

BA 452 Lesson B.6 Nonlinear Programming 56 BA 452 Quantitative Analysis End of Lesson B.6

Similar presentations