You are on page 1of 14

Crystal Ball and OptQuest

Mini Class Material

Online tutorials and registration for mini classes at:


http://tradingroom.bentley.edu

2006© Hughey Center for Financial Services. All Rights Reserved.


Hughey Center for Financial Services Crystal Ball: OptQuest

Table of Contents
Content Page

Brief Description of the Software Suite 3

Launching Crystal Ball 3

Using Sample Spreadsheet Models 4

Defining Assumptions 4

Defining Decision Variables 6

Defining the Forecast 7

Setting Run Preferences 8

Launching OptQuest 9

Specifying Constraints 9

Selecting the Forecast Objective 10

Running the Optimization 11

Viewing the Results of the Optimization 12

Editing the Optimization File 13

Interpreting the Results 14

2
Hughey Center for Financial Services Crystal Ball: OptQuest

BRIEF DESCRIPTION

Part of the Crystal Ball Professional Suite, Crystal Ball 2000 and OptQuest can be used to
conduct linear and nonlinear optimizations. Optimization is the process of finding the best, or
optimal, solution for a problem using simulation and mathematical models. This technique is very
important when analyzing model variables that can be manipulated and controlled (e.g., R&D
expenditures or credit risk exposure). For this reason, Crystal Ball is widely used by marketing,
management, and finance professionals faced with budget-constrained problems. Through the
proper use of Crystal Ball, these professionals will be able to evaluate the alternatives and make
sound investment decisions.

To demonstrate the use of Crystal Ball, the following tutorial has been created. In this tutorial,
an investment manager is analyzing the allocation of $100,000 in investable funds. Given four
asset classes (money market, income, growth and income, and aggressive growth), Crystal Ball is
used to determine the optimal allocation based on the client’s investment objectives.

LAUNCHING CRYSTAL BALL

On the desktop, double click on the Crystal Ball icon. Crystal Ball works within the
Microsoft Excel environment. It is imperative not to close the Crystal Ball Simulator tab at the
bottom of the taskbar because it will suspend Crystal Ball’s ability to run simulations.

The following additional menus appear on the top toolbar:

The Crystal Ball toolbar appears below the regular Excel toolbar and includes the following basic
functions:

Define Assumptions Clear Data Stop Simulation

Define Decision Define Forecast Run Simulation Step-by-step Simulation

3
Hughey Center for Financial Services Crystal Ball: OptQuest

USING SAMPLE SPREADSHEET MODELS

Crystal Ball has a number of example spreadsheet models to help you better understand the
capabilities of the software suite.

A spreadsheet model for this problem is available on the X:\ drive. To access the file:

1. File > Open


2. Choose New X drive > A. Mini-classes > D. Crystal Ball
3. Select file labeled Portfolio Allocation.xls

In this model, an investment manager has $100,000 to invest in four assets. Below is a list of the
assets’ expected annual returns, and the minimum and maximum amounts the investor is
comfortable allocating to each investment.

Investment Annual Return Lower Bound Upper Bound


Money Market Fund 3% $0 $50,000
Income Fund 5% $10,000 $25,000
Growth and Income Fund 7% $0 $80,000
Aggressive Growth Fund 11% $10,000 $100,000

The source of uncertainty in this problem is the annual return of each asset. The decision
problem, then, is to determine how much to invest in each asset to maximize the total expected
annual return while maintaining the risk at an acceptable level, and observing the minimum and
maximum limits for each investment.

DEFINING ASSUMPTIONS

In Crystal Ball, you define an assumption for a value cell by choosing a probability distribution
that describes the uncertainty of the data in the cell. To accomplish this, you select from the 21
distribution types in the Distribution Gallery. Choosing the appropriate distribution can be
challenging. The following chart outlines the appropriate distribution for the four asset classes.

Assumption Cell Distribution Parameters


Money Market Fund C5 Uniform Minimum: 2%, Maximum: 4%
Income Fund C6 Normal Mean: 5%, Standard deviation: 5%
Growth and Income Fund C7 Normal Mean: 7%, Standard deviation: 12%
Aggressive Growth Fund C8 Normal Mean: 11%, Standard deviation: 18%

4
Hughey Center for Financial Services Crystal Ball: OptQuest

The uniform distribution is used in situations where all values between the minimum and
maximum values are equally likely to occur. Such a distribution would be appropriate for a
money market fund.

To define the assumption cell for the Money Market Fund:

1. Click on cell C5.

2. Select Define > Define Assumption or click on the Define Assumption icon on the toolbar.
The Distribution Gallery dialog box appears.

3. Select the Uniform Distribution icon.

4. Click on OK. The Uniform Distribution dialog box appears. The Uniform distribution has two
parameters, a minimum and maximum value. According to the example, the investment
manager expects a return between 2.00% and 4.00%.

5. Type 2.00% in the Minimum field. Press the tab key and type 4.00% in the Maximum field.

6. Click Enter. The distribution changes to reflect the values you entered. Click on OK to return
to the spreadsheet. The assumption cell is now green.

Likewise, the normal distribution has two parameters: mean and standard deviation. The normal
distribution is appropriate for most securities and mutual funds, where the arithmetic mean and
standard deviation can be computed.

1. Click on cell C6.

2. On the top toolbar, select Define > Define Assumption or click on the Define Assumption
button on the Crystal Ball toolbar. The Distribution Gallery dialog box appears.

5
Hughey Center for Financial Services Crystal Ball: OptQuest

3. Select the Normal Distribution icon.

4. Click on OK. The Normal Distribution dialog box appears.

5. Type 5.00% in the Mean field. Press the tab key and type 5.00% in the Standard Deviation
field.

6. Click on Enter. The distribution changes to reflect the values you entered. Click on OK to
return to the spreadsheet. The assumption cell is now green.

Use the steps outlined above to define the characteristics of the normal distribution for the
Growth and Income and Aggressive Growth funds.

DEFINING DECISION VARIABLES

The next step is to identify the decision variables in the model. In this case, the decision is how
much to invest in each asset class. Use the following step to define the variables:

1. Select cell C13.

2. On the top toolbar, select Define > Define Decision or click on the Define Decision button
on the toolbar. The Define Decision Variable dialog box appears.

3. Set the Lower and Upper bounds according to the problem data.

6
Hughey Center for Financial Services Crystal Ball: OptQuest

4. Set the Variable Type Continuous. Click OK to return to the spreadsheet. The Decision
Variable cell is now yellow.

Define the decision variables for cells C14, C15, and C16 according to the values in columns D
and E of the worksheet using the same procedure as the Money Market Fund.

DEFINING THE FORECAST

The last cell that needs to be identified is the forecast cell. In this case, we want to forecast the
expected return of the portfolio for the asset allocation chosen. To define the forecast cell:

1. Select cell C17.

2. Select Define > Define Forecast or click on the Define Forecast button on the toolbar.
The Define Forecast dialog box appears.

3. Set the units as either “Dollars” or “$”.

4. Click OK to return to the spreadsheet. The forecast cell is now blue.

7
Hughey Center for Financial Services Crystal Ball: OptQuest

SETTING RUN PREFERENCES

Before running the simulation, you must set the run preferences.

1. Select Run > Run Preferences on the top menu or select the Run Preference icon on the
toolbar.

2. Set the Maximum number of Trials to 500 and leave the Confidence level at the default value
of 95%

3. Click on the Sampling tab.

4. Under Random Number Generation, check off the box “Use same sequence of random
numbers” and set the Initial seed value to 999.

5. Choose Latin hypercube as the Sampling method. Click OK.

8
Hughey Center for Financial Services Crystal Ball: OptQuest

LAUNCHING OPTQUEST

Start OptQuest by selecting Run > OptQuest. The OptQuest toolbar appears and includes the
following basic functions:

Decision Forecast Performance Solution


Variable Variable Graph Analysis

Constraints Run Bar Graph Optimization


Optimization Log

1. In OptQuest, select File > New or click on the “New” button. A wizard starts, leading you
through steps to create a new optimization file.

2. The Decision Variable Selection window appears. Every decision variable defined in the
Crystal Ball model appears in the Decision Variable Selection window. Click the radio button
by each decision variable to optimize all decision variables. By default, all decision variables
should already be selected.

3. Click OK. The Constraints window appears.

SPECIFYING CONSTRAINTS

The Constraints window lets you specify any restrictions. The constraint in this model limits the
initial investment to $100,000.

The right side of the Constraints window lists the selected decision variables. Constraints can
only use linear combinations of these variables. Enter constraining equations on the window,
placing each constraint on its own line.

1. Click on “Sum All Variables” located to the right of the Constraint window.

9
Hughey Center for Financial Services Crystal Ball: OptQuest

2. Put a less-than sign (<) before the equals sign.

3. Enter the total investment as 100000.

4. Click on OK. The Forecast Selection window appears.

SELECTING THE FORECAST OBJECTIVE

OptQuest requires that you select one forecast statistic to be the objective to minimize or
maximize. In addition to defining an objective, you can define optimization requirements.

1. From the Select drop-down menu, choose Maximize Objective. The default Forecast Statistic
is the mean.

2. Click OK. The Options window appears.

The goal for this example is to maximize the mean of the only forecast cell. For many problems,
the mean (expected value) of the forecast is the most appropriate statistic to optimize; but it need
not always be.

10
Hughey Center for Financial Services Crystal Ball: OptQuest

RUNNING THE OPTIMIZATION

In the Options window, you set options for controlling the optimization process.

1. Set the optimization to run for 2 minutes. Click OK.

2. OptQuest will prompt you to run the optimization. Click Yes. The Status and Solutions
window appears. Each time OptQuest identifies a better solution during the optimization, it
adds a new line to the Status and Solutions window, showing the new objective value and the
values of the decision variables.

The time remaining and the simulation number under evaluation appear in the upper left corner of
the window. This information disappears when the time limit if reached. While the optimization
is running, you can select three commands from the View menu:

1. Performance Graph – Shows a plot of the objective value as a function of the number of
simulations evaluated. When using the wizard, this window opens automatically.
2. Bar Graph – Shows how the value of each decision variable changing during the optimization
search procedure.
3. Optimization Log – Provides details of the sequence of solutions generated during the search.
4. Efficient Frontier – Plots a set of objective values found over the range of a variable
requirement.

The last line in the Status and Solutions window shows the best solution found by OptQuest. All
the money is allocated to the fund that has the highest return - the Aggressive Growth fund - with
the exception of the minimal amount in the Income fund that the investor required. In other
words, the investor’s strategy maximized the return of the portfolio, but at a price: high risk due
to high volatility and little diversification.

11
Hughey Center for Financial Services Crystal Ball: OptQuest

VIEWING THE RESULTS OF THE OPTIMIZATION

1. After OptQuest completes the optimization, copy the optimization results to your model by
selecting Edit > Copy to Excel.

2. In Excel, view the forecast chart for the best simulation by selecting Analyze > Forecast
Charts > Total Expected Return > Open if the chart does not appear automatically.

3. In the Forecast window, select View > Statistics. The forecast statistics for the optimization
will appear. Note that the standard deviation of the forecast, $16,342 is quite high compared
to the mean return of $10,421. The coefficient of variability is shown as 1.58 or above 150%.

12
Hughey Center for Financial Services Crystal Ball: OptQuest

EDITING THE OPTIMIZATION FILE

Suppose that this same investor wants to reduce uncertainty of returns for the portfolio, while still
attempting to maximize the expected return. You might want to find the best solution for which
the standard deviation is much lower, say below $8,000.

Edit the optimization file to add this risk limitation and still maximize the total expected return.

To edit the optimization file:

1. Return to OptQuest by clicking on the OptQuest tab on the Windows taskbar.

2. Open the Forecast Selection window by clicking on the icon on the toolbar menu.
The window appears with the Total Expected Return forecast listed in the first row.

3. Click in the existing forecast window.

4. Select Edit > Duplicate. This creates a new row, with the forecast named Total expected
return: 2.

5. In the new row, select Requirement from the Select list.

6. From the Forecast Statistic drop-down list, select standard deviation (Std_Dev).

7. Set the Upper Bound to 8000. This adds a requirement that the standard deviation of the
expected returns must be less than $8,000 for a solution to be considered feasible.

13
Hughey Center for Financial Services Crystal Ball: OptQuest

8. Click on OK.

9. Re-run the optimization by selecting Run > Start or clicking on the Start button on the
toolbar.

10. After the optimization completes, save the current optimization settings by selecting File >
Save. Name the file Portfolio_Allocation.opt and save it in your folder in the Y:\ drive.
Note: This saves only the optimization settings; you must save the Crystal Ball model
separately in Excel. Optimization files automatically have the extension .OPT, and you can
reopen them by selecting File > Open the next time you run OptQuest.

11. To exit OptQuest, select File > Exit. If the optimization file has not been saved, OptQuest will
prompt you to save it.

12. OptQuest will also ask if you want to copy the best solution into your spreadsheet model.
Click Yes and OptQuest will then copy the best solution into your Crystal Ball model You can
also copy one of the other solutions into your Crystal Ball model by selecting the
corresponding row in the Status and Solutions window before exiting. The associated
simulation for the selected solution is automatically restored when you exit.

INTERPRETING THE RESULTS

This solution has significantly reduced the variability by finding the best diversification of
conservative and aggressive investments. Crystal Ball results for the first solution overlaid on top
of the new solution.

The accuracy of the results depends on the time limit you select for searching, the number of trials
per simulation, the number of decision variables, and the complexity of the problem. After solving
an optimization problem with OptQuest, run a longer Crystal Ball simulation using the optimal
values of the decision variables to more accurately compute the risks of the recommended
solution.

14

You might also like