Professional Documents
Culture Documents
Spreadsheet model
Solver
Templates: InvestmentProblem_Template.xlsx
An Investment Problem 3
Brian Givens is a financial analyst for Retirement Planning Services, Inc. who
specializes in designing retirement income portfolios for retirees using
corporate bonds.
Brian and his client agreed to consider upcoming bond issues from the
following six companies:
– the annual yield on each bond
– the length of time over which the bonds will be payable
– an independent under-writer’s assessment of the quality or risk
associated with each issue.
Brian believes that all of the companies are relatively safe investments.
However, to protect his client’s income, Brian and his client agreed that
– no more than 25% of her money should be invested in any one
investment
– at least half of her money should be invested in long-term bonds that
mature in 10 or more years.
– even though DynaStar, Eagle Vision, and OptiPro offer the highest
returns, it was agreed that no more than 35% of the money should be
invested in these bonds because they also represent the highest risks
(that is, they were rated lower than “very good”).
Decisions to be made
Performance measure
Decisions variables
Objective function
Constraints
Spreadsheet Model for LP 7
Four steps
– Input cells
– Changing cells
– Objective cell
– Constraints
Excel Solver
Open InvestmentProblem_Template.xlsx
Step 1: Input Cells 8
Enter all of the data for the problem onto the spreadsheet.
It is a good idea to color code these “input cells” (e.g., light blue).
A B C D G
2 Company Return Years to Maturity Rating 2 Limit
3 Acme Chemical 8.65% 11 1 3 25%
4 DynaStar 9.50% 10 3 4 25%
5 Eagle Vision 10.00% 6 4 5 25%
6 MicroModeling 8.75% 10 1 6 25%
7 OptiPro 9.25% 7 3 7 25%
8 Sabre Systems 9.00% 13 2 8 25%
Step 2: Changing Cells
Add a cell in the spreadsheet for every decision that needs to be made.
It is a good idea to color code these “changing cells” (e.g., yellow with
border).
A B C D E F G
2 Company Return Years to Maturity Rating Portfolio Limit
3 Acme Chemical 8.65% 11 1 10.00% 25%
4 DynaStar 9.50% 10 3 10.00% 25%
5 Eagle Vision 10.00% 6 4 10.00% 25%
6 MicroModeling 8.75% 10 1 10.00% 25%
7 OptiPro 9.25% 7 3 10.00% 25%
8 Sabre Systems 9.00% 13 2 10.00% 25%
Step 3: Objective Cell 10
Typically this equation involves the data cells and the changing cells in
order to determine a quantity of interest (e.g., total profit or total cost).
A B C D E F G
2 Company Return Years to Maturity Rating Portfolio Limit
3 Acme Chemical 8.65% 11 1 10.00% 25%
4 DynaStar 9.50% 10 3 10.00% 25%
5 Eagle Vision 10.00% 6 4 10.00% 25%
6 MicroModeling 8.75% 10 1 10.00% 25%
7 OptiPro 9.25% 7 3 10.00% 25%
8 Sabre Systems 9.00% 13 2 10.00% 25%
A B C D E F G
10 Annual Return of Portfolio 5.52% =SUMPRODUCT(B3:B8,E3:E8)
Step 4: Constraints 11
To model the constraint on long term bonds, we calculate in cell A13 the
percentage of investment on long term bonds:
A13 = E3+ E4 + E6 +E8
We also have in cell C13 the lower limit (50%).
A B C D E F G
2 Company Return Years to Maturity Rating Portfolio Limit
3 Acme Chemical 8.65% 11 1 10.00% 25%
4 DynaStar 9.50% 10 3 10.00% 25%
5 Eagle Vision 10.00% 6 4 10.00% 25%
6 MicroModeling 8.75% 10 1 10.00% 25%
7 OptiPro 9.25% 7 3 10.00% 25%
8 Sabre Systems 9.00% 13 2 10.00% 25%
A B C
11 =E3+E4+E6+E8
12 % of investment on long-term bonds: 50%
13 40.00% >= 50%
Step 4: Constraints 12
To model the constraint on high risk bonds, we calculate in cell A15 the
percentage of investment on high :
A15 = E4 + E5 + E7
We also have in cell C15 the upper limit (35%).
A B C D E F G
2 Company Return Years to Maturity Rating Portfolio Limit
3 Acme Chemical 8.65% 11 1 10.00% 25%
4 DynaStar 9.50% 10 3 10.00% 25%
5 Eagle Vision 10.00% 6 4 10.00% 25%
6 MicroModeling 8.75% 10 1 10.00% 25%
7 OptiPro 9.25% 7 3 10.00% 25%
8 Sabre Systems 9.00% 13 2 10.00% 25%
A B C
14 % of investment on bonds of "highest" risk: 35%
15 30.00% <=
=E4+E5+E7 35%
Step 4: Constraints 13
To model the constraint total investment, we calculate in cell A17 the total
percentage of all bonds:
A17 = sum(E3:E8)
We also have in cell C17 the requirement (100%).
A B C D E F G
2 Company Return Years to Maturity Rating Portfolio Limit
3 Acme Chemical 8.65% 11 1 10.00% 25%
4 DynaStar 9.50% 10 3 10.00% 25%
5 Eagle Vision 10.00% 6 4 10.00% 25%
6 MicroModeling 8.75% 10 1 10.00% 25%
7 OptiPro 9.25% 7 3 10.00% 25%
8 Sabre Systems 9.00% 13 2 10.00% 25%
A B C
16 Total Investment
17 60.00% =
=SUM(E3:E8) 100%
A Trial Solution 14
A B C D E F G
2 Company Return Years to Maturity Rating Portfolio Limit
3 Acme Chemical 8.65% 11 1 10.00% <= 25%
4 DynaStar 9.50% 10 3 10.00% <= 25%
5 Eagle Vision 10.00% 6 4 10.00% <= 25%
6 MicroModeling 8.75% 10 1 25.00% <= 25%
7 OptiPro 9.25% 7 3 25.00% <= 25%
8 Sabre Systems 9.00% 13 2 20.00% <= 25%
9
10 Annual Return of Portfolio 9.12%
11
12 % of investment on long-term bonds: 50%
13 65.00% >= 50%
14 % of investment on bonds of "highest" risk: 35%
15 45.00% <= 35%
16 Total Investment
17 100.00% = 100%
Solver Setup 15
An Optimal Solution 16
A B C D E F G
2 Company Return Years to Maturity Rating Portfolio Limit
3 Acme Chemical 8.65% 11 1 15.00% <= 25%
4 DynaStar 9.50% 10 3 10.00% <= 25%
5 Eagle Vision 10.00% 6 4 25.00% <= 25%
6 MicroModeling 8.75% 10 1 25.00% <= 25%
7 OptiPro 9.25% 7 3 0.00% <= 25%
8 Sabre Systems 9.00% 13 2 25.00% <= 25%
9
10 Annual Return of Portfolio 9.19%
11
12 % of investment on long-term bonds: 50%
13 75.00% >= 50%
14 % of investment on bonds of "highest" risk: 35%
15 35.00% <= 35%
16 Total Investment
17 100.00% = 100%
Solver Limitations and Alternatives 17
– Cplex: https://www.ibm.com/analytics/cplex-optimizer
Open Solver 18
Python Code 19
Who use Linear Programming 20
1988-2004
– Algorithms (machine independent): 3300X.
– Machines (workstationPCs): 1600X
– NET: algorithm*machine: 5,300,000X (2months1 second)
2004-
– Algorithm development for very large scale LPs
– Challenging applications still exist