0% found this document useful (0 votes)
38 views60 pages

Chapter 7

Uploaded by

Chan Hin Chun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views60 pages

Chapter 7

Uploaded by

Chan Hin Chun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 60

Chapter 7

Nonlinear Optimization
Models
Linear Programming Model
 A linear objective function
 A set of linear constraints

Minimize 6 x1+ 8 x2
Subject to

2 x1+ 4 x2  16
4 x1+ 3 x2  24
x1  0
2
x2  0
Non-linear Programming Model
 A non-linear objective function, or

 Some or all constraints are non-linear

3
This Chapter

• Non-linear Optimization problem

How to solve with Solver

Application for Pricing Optimization Model

Application for Portfolio Optimization Model

4
A Problem Solver Has Difficulty:

Maximize y = (x – 1)(x – 2)(x – 3)(x – 4)(x – 5)


Subject to 1  x  5

2.5

1.25

0
1 2 3 4 5

-1.25

-2.5
5
Local Optimization vs. Global Optimization

Local optimal solution:


2.5
•A solution that is the best
compared to feasible 1.25

solutions in its neighbor 0


1 2 3 4 5

-1.25
Global optimal solution:
•A solution that is the best -2.5

among all feasible


solutions
6
Local Optimization vs. Global Optimization
Maximize y = (x – 1)(x – 2)(x – 3)(x – 4)(x – 5)
Subject to 1  x  5
2.5

1.25

0
1 2 3 4 5

-1.25

-2.5

• We may only obtain a local optimal solution, instead of a global


7
optimal solution, for a general nonlinear optimization problem.
Questions

• Under what conditions we are guaranteed to


get a global optimal solution?

• What can be done if the conditions are not


satisfied (or if we are not sure whether the
conditions are satisfied)?

8
Convex Functions

Slope is increasing 9
Concave Functions

Slope is decreasing 10
Two dimensional convex/concave faces

11
Convex Functions
 A local minimum of a convex function is a
global minimum
 Function f(x) is convex if f”(x)  0;
 If f(x) and g(x) are convex, then for a, b 0,

a f(x) + b g(x) is also convex


 If f(x) is convex, then –f(x) is concave

12
Convex Functions
 Some convex functions:

13
Concave Functions
 A local maximum of a concave function is a
global maximum
 Function f(x) is concave if f”(x)  0;
 Some concave functions:

14
Problems Solver Always Solves Correctly
 Sufficient conditions for maximization problems
– Constraints are linear
– Objective function is concave

 Sufficient conditions for minimization problems


– Objective function is convex
– Constraints are linear

 Note: Linear function is both convex and concave!


15
When assumptions do not hold or you
are not sure:
 Try different possible starting values for
the changing cells
 Run Solver from each of these
 Take the best solution Solver finds
– MultiStart option
16
Pricing Optimization

 Setting prices on products and services is becoming a


critical decision for many companies.

17
Example 7.1: A Pricing Optimization
Model
 The Links Company sells its
golf clubs at golf outlet
stores.
 The company knows that
demand for its clubs varies
considerably with price.

18
Questions
 The company would like to estimate the relationship between
demand and price.

 Assuming the unit cost of producing a set of clubs is $250, what


price should the company charge to optimize its profit?

19
Solution
 We use the best-fitting power curve y = axb
with a = 5,871,064 and b = -1.908 to predict demand from price.

 Profit = Demand *(Price – Cost)= axb(x-250)

 Optimal Price

 Global Optimal?

20
Peak-load and off-peak demands
 In many situations, there are peak-load and off-peak
demands for a product.
 In such a situation, it might be optimal for a producer to
charge a larger price for peak-load service than for off-
peak service.

21
Example 7.4 Pricing Electricity
 Florida Power and Light (FPL) faces demands during both peak-load and off-
peak-load times.
 FPL must determine
– prices per kilowatt hour to charge during peak and off-peak periods,
– capacity to maintain, which costs $10 per day per kwh.
 The daily demand for power during each period (in kwh) is related to price as
follows:
Dp = 60 – 0.5Pp + 0.1Po
Do = 40 + 0.1Pp – Po

Here, Dp and Pp are demand and price during peak time, whereas
Do and Po are demand and price during off-peak time.

http://www.eia.gov/todayinenergy/detail.cfm?id=5110 22
Ex. 7.4(cont’d) – Influence Diagram
Peak period
Peak period
price
Revenue in price
Peak period
Peak period
Revenue Off-peak
demand
period price

Revenue in off- Off-peak


peak period period price
Profit
Off-peak
Off-peak period price
Capacity period demand
Cost
Peak period
price

Unit Maintenance
Cost
23
Formulation
 To solve this problem, we must keep track of :
– The peak and off-peak price

– The peak and off-peak demand

– The peak and off-peak revenue

– The capacity (in kwh)

– The cost of capacity

– The total profit

24
Is the Solver Solution Optimal?

 All of the constraints in this example are linear.

 Also, it can be shown that the objective (daily profit) is a concave


function of peak price, off-peak price and capacity level.

25
Sensitivity Analysis
 We vary the unit cost of capacity from $5 to $15.
 As the cost of the capacity increases, the peak-load price
increases, the off-peak price stays constant, the optimal capacity
decreases.
 Why does the peak-load price increase but not the off-peak price?
Unit cost Peak price Off-peak price Capacity Profit
$5 $67.81 $26.53 28.75 $2,342.92
$6 $68.31 $26.53 28.50 $2,314.30
$7 $68.81 $26.53 28.25 $2,285.92
$8 $69.31 $26.53 28.00 $2,257.80
$9 $69.81 $26.53 27.75 $2,229.92
$10 $70.31 $26.53 27.50 $2,202.30
$11 $70.81 $26.53 27.25 $2,174.92
$12 $71.31 $26.53 27.00 $2,147.80
$13 $71.81 $26.53 26.75 $2,120.92
$14 $72.31 $26.53 26.50 $2,094.30
$15 $72.81 $26.53 26.25 $2,067.92 26
Portfolio Optimization
Portfolio optimization models
 Given a set of possible investments, how do financial analysts
determine the portfolio that has the lowest risk and yields a high
expected return?
 This question was answered by Harry Markowitz in the 1950s.
For his work on this and other investment topics, he received the
Nobel Prize in economics in 1990.

28
Invest

in
what?

29
Returns
and
risks

30
Portfolio Optimization (Asset Allocation)
 Problem: How to invest your money to obtain a specific expected
return level while minimizing the potential risk.

 Suppose
– n possible investments;

– Yi be the (random) return earned during a year on a dollar from investment i;

– xi be the fraction of money invested in investment i; (The decision variables)


– Then the annual return (rate) on the investments, denoted as R, is given by

R = x1 Y1 + x2 Y2 + … + xn Yn
31
Portfolio Optimization
 Portfolio Optimization Problem: To minimize the variance of R under the constraint that the Expected
value of R ≥ Some number.

Minimize Var (R)

subject to E(R) ≥ R0

x1, x2, …, xn≥0 Decision variables:


x1, x2, …, xn

32
Portfolio Optimization

 Historical-data approach:
– use historical data to estimate Var(R) and E(R)

– solve the resulted optimization problem

33
Portfolio Optimization: Historical-data approach
 μi : (sample) expected value of Yi
R = x 1 Y1 + x2 Y2 + … + x n Yn

si : (sample) standard deviation of Yi
 rij : coefficient of correlation of Yi and Yj;

Cij : covariance of Yi and Yj: Cij = rij si sj A linear function

 We have:
A convex function
Expected value of R = x1 μ1 + x2 μ2 + … + xn μn

Variance of R =

34
For n=3

Left Hand Side


2 2 2 2 2 2
= x1 s1 + x2 s + xx r ss + x xr s s
s 2 + x3 3 1 2 12 1 2 2 1 21 2 1
+ x x r s s +x x r s s
1 3 13 1 3 3 1 31 3 1

+ xxr ss+xxr ss
2 3 23 2 3 3 2 32 3 2

Right Hand Side


2 2 2
= x1 C11 + x2 C 22 + x3 C 33 + xxC 1 2 12
+ x2 x1 C 21 + x1 x3 C13 + x3 x1 C 31
+ x xC
2 3 23
+ xxC 3 2 32

36
Calculating Expected Value and Variance of
R in Excel New version: VAR.S

Average function for calculating μi
 VAR function for calculating New version: STDEV.S

Or STDEV function for calculating si


CORREL function for calculating rij (then Cij = rij si sj , or)
 COVARIANCE.S function for Cij

37
Calculating Expected Value and Variance of
R in Excel

38
Matrix in Mathematics
 A matrix is a rectangular array of numbers.
 It is a powerful tool to show complex relationship in a neat way.
 An m* n matrix has m rows and n columns.
 If m or n is 1, then it is a row or column vector.

39
Matrix Operations
 Addition

 Subtraction

 Transpose of a matrix

 Multiplication
40
Matrix Addition/Subtraction

41
Matrix Transpose

42
Matrix Multiplication
 Matrix product rule: if A is an m * r matrix, B is a r * n matrix,
A*B=C is an m * n matrix:
– the value in row i and column j of C is the sumproduct of row i of A and column j
of B.


8 17
 1 0 1 2 
 

 25 59
 0 1 1 0 
1 4   
 
 2 1 1 3
*



 7 16




= 


8 20

 43
 


 5 13





39 93 

 1
 3
1 2 1 3 *  = (13)
 0
 
 2

3 1 1
 1 0 1 2 1  5 4 9 
 0 1 1 0 0 2 3 1 4 
 

* 2 1 2
=  
 2 1 1 3    9 6 15
0 1 3

44
 1 0 1 2 3 1 1 
1 2 
1

1 2 
0 2 5 4 9 

 0 1 1 0   

*5
 

* 10
= *5
 
    3 1 4  
10 

 2 1 1 3 2 1 2 


  




   0 1  
0 1 

0 1 3    9 6 15 



8 17
 1 0 1 2 
 

 25 59
 0 1 1 0 
1 4   

=  
 2 1 1 3
*



 7 16




= 


8 20


 


 5 13





39 93 

45
Matrix Multiplication in Excel
 To obtain A*B in Excel
– Input A and B in Excel. Suppose A is a m*r matrix, B is a r*n matrix.
Suppose the related ranges named Mat1 and Mat2 respectively;

– Choose a range of m rows and n columns;

– Type MMULT(Mat1, Mat2);

– Press Ctrl-Shift-Enter

46
Matrix in Mathematics

47
 x1 C11  x2 C12  x3 C13 
= x x x 
1 2 3

 x1 C 21  x2 C 22  x3 C 23

x C x C x C 
 1 31 2 32 3 33 

2 2 2
= x1 C11 + x2 C 22 + x3 C 33 + xxC 1 2 12
+ x2 x1 C 21 + x1 x3 C13 + x3 x1 C 31
+ x xC
2 3 23
+ xxC 3 2 32

48
Matrix in Mathematics
 In Excel, A*C*AT can be calculated by

MMULT(VectorA,MMULT(MatrixC,TRANSPOSE(VectorA))

49
Example 7.9 Portfolio Optimization
 Perlman & Brothers, an investment company, can invest in three
stocks. From past data, the means and standard deviations of
annual return, and the correlation between the annual returns on
the stocks, have been estimated.
Stock 1 Stock 2 Stock 3
Mean return 0.14 0.11 0.1
StDev of return 0.2 0.15 0.08

Correlations Stock 1 Stock 2 Stock 3


Stock 1 1 0.6 0.4
Stock 2 0.6 1 0.7
Stock 3 0.4 0.7 1

 The company wants to find a minimum-variance portfolio that


yields an expected annual return of at least 0.12.
50
Formulation
 To model Perlman’s problem, we must keep track of :
– The fraction of money invested in each stock

– The total fraction of Perlman’s money invested

– The expected annual return of the portfolio

– The variance of the annual portfolio return

51
Portfolio Variance
Portfolio variance =
Invested fractions * CovarMat * Transpose(Invested fractions)
where CovarMat is a matrix of covariances for the particular
investments.
We need to calculate a matrix of covariances.
The covariance between returns of stock i and stock j is

si sj rij

52
Solution
 The solution indicates that the company should put half of its
money in each of stocks 1 and 3, and none in stock 2.
 We can interpret the portfolio standard deviation of 0.1217 in a
probabilistic sense.
 If we believe that stock returns are approximately normally
distributed, then the probability is about 0.68 that the actual
portfolio return will be within one standard deviation of the
expected return, and the probability is about 0.95 that the actual
portfolio return will be within two standard deviations of the
expected return.

53
Sensitivity Analysis
 As the company requires larger returns (on average), it must
assume a larger risk. We vary the required return from 0.10 to
0.14 in increments of 0.005.

54
Efficient Frontier

55
Efficient Frontier
 Points on the efficient frontier can be achieved by appropriate
portfolios.
 Points below the efficient frontier can be achieved, but they are
not as good as points on the efficient frontier because they have
a lower expected return for a given level of risk.
 Points above the efficient frontier are unachievable – the
company cannot achieve an expected return this high for a given
level of risk.

56
Example: Portfolio Optimization when there is no
historical data – the scenario approach (optional)
 For the next year the Security Analysis Company (SAC) has identified seven
equally likely scenarios.
 SAC wants to find the minimum variance portfolio that yields an expected
annual return of at least 0.13.

Stock 1 Stock 2 Stock 3 Prob.


Scenario 1 -0.071 0.144 0.169 0.143
Scenario 2 0.056 0.107 -0.035 0.143
Scenario 3 0.038 0.321 0.133 0.143
Scenario 4 0.089 0.305 0.732 0.143
Scenario 5 0.090 0.195 0.021 0.143
Scenario 6 0.083 0.390 0.131 0.143
57
Scenario 7 0.035 -0.072 0.006 0.143
Developing the Model
 If a random variable V has possible values v1 through vn, with
associated probabilities p1 through pn respectively, then its
expected value, E[V], is given by n
E[V ]  vi pi
i 1
and its variances is

2 n
Var (V ) E [V  E (V )]  [vi  E (V )]2 pi
i 1

58
Developing the Model

n
Expected value  vi pi
i 1
n
Variance  [vi  E (V )] pi
2

i 1

59
Another Method for Solving Non-
Linear Programming Models
 Evolutionary Method
– For problems that are non-smooth non-linear

60
Exercise
– 60,62, 67

– 39 (ignore the hint), 63.

61

You might also like