Professional Documents
Culture Documents
OptiFolio
Portfolio Optimization and Simulation Software
User's Guide
Updated: June 15th, 2014
www.risk-o.com
OptiFolio
USER'S GUIDE
CONTENTS
I. OVERVIEW .......................................................................................................................................... 3
I.1. TYPICAL WORKFLOW USING OPTIFOLIO........................................................................................................ 3
I.2. OVERVIEW OF PROGRAM FEATURES ............................................................................................................ 4
II. IMPORTING DATA AND CONFIGURING OPTIFOLIO ............................................................................ 9
II.1. CONFIGURING HISTORICAL PRICES IN AN MS EXCEL WORKSHEET .................................................................... 9
II.2. IMPORTING MARKET PRICES FROM MS EXCEL OR DELIMITED FILES ................................................................. 9
II.3. IMPORTING MARKET PRICES FROM THE WEB .............................................................................................. 10
II.4. PARAMETERS CONFIGURATION ................................................................................................................ 12
III. THE DATA MANAGER ...................................................................................................................... 13
III.1. ASSET PRICES, RETURNS, AND STATISTICS.................................................................................................. 13
III.1.A. Historical prices ...................................................................................................................... 13
III.1.B. Asset returns ........................................................................................................................... 14
III.1.C. Return statistics ...................................................................................................................... 15
(i) Editing assumptions .................................................................................................................................. 16
(ii) Positive definiteness ................................................................................................................................. 18
OptiFolio
USER'S GUIDE
I. OVERVIEW
OptiFolio allows you to conduct constrained portfolio optimization using both the Modern Portfolio
Theory approach (the Markowitz-Sharpe model) and the contemporary Conditional VaR model.
Furthermore, OptiFolio makes it easy to apply Monte Carlo Simulations in order to generate forecasted
scenarios for assets and portfolio values. The application provides you with a user-friendly interface
where you can change your assumptions, create and edit user portfolios, explore each point of the
efficient frontier, and much more.
OptiFolio
USER'S GUIDE
Load historical prices data from an MS Excel workbook, delimited file, or from the web.
Various return statistics, such as mean returns, covariances, and correlations, which can
be calculated from data, pasted from the clipboard, or manually edited.
The Monte Carlo Simulation, which forecasts the future performance for each asset.
OptiFolio
USER'S GUIDE
OptiFolio finds the optimum portfolios with maximum Sharpe ratio and minimum standard
deviation or maximum expected Return/CVaR and minimum CVaR according to each chart
type. Additionally it calculates every point of the efficient frontier and displays them in a table or
in a chart.
OptiFolio
USER'S GUIDE
OptiFolio allows the user to define asset groups and limits for the portfolio. Groups and limits
are also stored in human readable files.
OptiFolio
USER'S GUIDE
The user can interactively explore the optimum asset combinations along the efficient frontier, as
shown below. Portfolios of interest can be saved to the Portfolio Manager by double-clicking.
OptiFolio
USER'S GUIDE
Manage user-defined portfolios, calculate statistics, and conduct Monte Carlo Simulations.
OptiFolio
USER'S GUIDE
The first row should contain the headings for each column.
The first column (A) should contain the date for each price observation.
The following columns should contain the historical prices for each asset, all expressed in the
same currency.
OptiFolio
USER'S GUIDE
If the workbook contains more than one spreadsheet, select the appropriate worksheet from the list. If the
workbook has only one, it will be selected automatically.If the number of assets is greater than 255, a flat
file (Comma-Separated orTab-Delimited) should be used instead of an MS Excel formatted file.
The asset list will be saved into the Optifolio.ini file, so the next time the program is opened, the list will
appear as on the previous session.
10
OptiFolio
USER'S GUIDE
By default, OptiFolio will try to auto-configure an available data source for your region and contract
type. You can manually introduce the connection parameters by pressing the Configure... button.
In order to configure a connection, first check if there are any available auto-configurable sources on the
drop-down. Select the auto-configurable source and press OK to the make the configuration active.
Alternatively, manually enter the connection parameters (source name, help URL, general information
access URL, and historical prices URL). OptiFolio will replace the following variables with their
appropriate values before invoking the download procedure:
%1 ................ Asset symbol or ID
%2 ................ Initial date month number (011)
%3 ................ Initial date day number (131)
%4 ................ Initial date year number (4 digits)
%5 ................ Ending date month number (011)
%6 ................ Ending date day number (131)
%7 ................ Ending date year number (4 digits)
%8 ................ Frequency indicator letter (d for daily, w for weekly)
The web page is expected to return the following information in comma-separated format:
11
OptiFolio
USER'S GUIDE
Risk-free rate
The annualized risk-free rate indicates the return on a risk-free asset (such as a US Treasury
Bill). This value will be used to calculate the risk premium (the excess return of an asset or
portfolio above the risk-free rate) and the Sharpe ratio.
(1 YearlyRFR )
1
DPY
Color palette
Choose a color palette to represent portfolio densities on each feasible combination of risk and
return.
All changes made on the parameters window will be automatically saved into the Optifolio.ini file
when the program is closed. This file will be loaded the next time OptiFolio is opened.
12
OptiFolio
USER'S GUIDE
To zoom in on a section of a chart, left click and drag the mouse pointer downwards. To return to the
default zoom level, click and drag upwards.
13
OptiFolio
USER'S GUIDE
P
rt ( t ) T 1
Pt L
14
OptiFolio
USER'S GUIDE
rt Ln(
Pt
HP
)
Pt L T
Pressing the Recalculate returns and update all statistics button will regenerate all internal returns and
return statistics matrices (means, covariances, correlations). This should usually be done each time one of
the Asset returns parameters is changed.
Return calculation:Example
st
nd
Lets assume that the first loaded prices correspond to the following dates:February 1 , 2 ,
th
and4 .Assume that the Holding Period is three working days, the price comparison distance
is one physical observation, and the calculation technique is geometric.
nd
st
The first return would be calculated comparing Feb 2 vs. Feb 1 (one physical observation
apart, one working day apart in this case) and would express the result for three working
days, as follows:
rFeb 2 (
PFeb 2
PFeb 1
)1 1
th
nd
The second return would be calculated comparing Feb 4 vs. Feb 2 (one physical
observation apart, two working days apart in this case) and would express the result for
three working days, as follows:
rFeb 4 (
PFeb 4
PFeb 2
3
2
) 1
15
OptiFolio
USER'S GUIDE
The Mean returns tab also contains the expected return vector. This vector is initially taken from
historical means, but it may be configured by the user.
The covariances and correlations matrices are interlinked. When any covariance or correlation changes,
a corresponding change will be automatically carried out on the other matrix in order to keep both
matrices consistent with each other.
Remember that expected returns and covariances are the main inputs for the portfolio optimization
models.
16
OptiFolio
USER'S GUIDE
If the same correlation is reduced even more, to -0.5 for instance, the chart will expand even further, as
expected.
17
OptiFolio
USER'S GUIDE
18
OptiFolio
USER'S GUIDE
They have the same dates and data length in comparison to the historical return matrix
Each column has a mean return equal to the expected mean return
Each column has a variance equal to the assumed variance for that variable
This data is used by the CVaR/Return portfolio optimization model as the raw data for the historical
CVaR calculation.
The general formula employed to transform each column (X) in order to achieve target statistics is:
At (
X t Mean(XHist )
) XTarget E(X)Target
XHist
19
OptiFolio
USER'S GUIDE
for the asset. Remember that not all assets may have a good fit to a smooth distribution, such as Normal
or T. In fact, it is very common to find assets that will not fit any known distribution.
Fig.26: Best-fitresults
20
OptiFolio
USER'S GUIDE
The results of the chart may also be found in tabular form on the Price simulation table tab.
The Copy paths button will copy the detail of each of the simulated value paths. Note that the amount
of information copied to the clipboard may be considerable depending on the number of requested
scenarios and the horizon of the simulation.
21
OptiFolio
USER'S GUIDE
Colors shown in the graph represent the relative density of portfolios on each Risk/Return combination
(this means that in hotter areas there are many portfolios with different internal weights that produce
the same combination of risk and return). The chart can be copied by right-clicking and selecting the copy
option.
22
OptiFolio
USER'S GUIDE
w j wk E( j ,k ) , w j E(rj )]
j 1 k 1
j 1
Note that this model is essentially parametric. In other words, it directly uses the expected returns and
covariances in order to estimate the portfolio statistics.
On the CVaR/Return model, the risk measure is not the standard deviation but the portfolio Conditional
Value-at-Risk (CVaR). In this case, the CVaR is calculated using the historical simulation method,
employing the Adjusted Returns discussed in the Data Manager section.
23
OptiFolio
USER'S GUIDE
The relevant formulas are presented here. Assume that given a vector of asset weights w, and a matrix
of adjusted returns AR, the hypothetical adjusted return vector of the portfolio is Rp:
R p w AR
Then, the Value-at-Risk of this vector with a significance level of
would be:
VaR( Rp , ) Percentile ( , Rp )
Hence, the Conditional Value-at-Risk of the vector will be:
CVaR ( R p , )
p
R p VaR ( RP , )
R p VaR ( RP , )
The portfolio coordinates for the CVaR/Return model will then be:
n
24
OptiFolio
USER'S GUIDE
OptiFolio has the option to savethese portfolios to the Portfolio Manager by using the buttons located
on the blue options bar.
25
OptiFolio
USER'S GUIDE
In order to get a better understanding of the chart, you can use the context menu to select among six
different color schemes.
26
OptiFolio
USER'S GUIDE
27
OptiFolio
USER'S GUIDE
Any frontier portfolio can be saved to the Portfolio Manager for further analysis by double-clicking onto
it.
You can also hover the mouse over any pure asset to see its name and coordinates.
28
OptiFolio
USER'S GUIDE
By moving the correlations sliders and the asset points themselves, you can set a broad spectrum of
configurations, such as the one shown below. You can copy the chart contents by right-clicking and
selecting 'Copy'.
29
OptiFolio
USER'S GUIDE
30
OptiFolio
USER'S GUIDE
31
OptiFolio
USER'S GUIDE
CVaR exhibits a smooth surface with one global optimum point, contrasting the chaotic surface of the
VaR statistic.
32
OptiFolio
USER'S GUIDE
33
OptiFolio
USER'S GUIDE
In the right corner, there is an option to load the groups that have been previously created, and next to it,
there is a button to save the groups. Groups can be loaded from three different data sources, as shown
below:
34
OptiFolio
USER'S GUIDE
Here you can see an example of the simple internal structure of these files.
35
OptiFolio
USER'S GUIDE
Limit sign
Select the limit sign (<= or >=) on the second drop-down list
Limit multiplied
If a comparison weight was selected, the multiplier will be applied to the comparison weight
before evaluating the limit.
Limit disabling
Check the final box in order to disable a limit instead of deleting it. Of course, you can enable it
later.
Like the asset groups, limits can also be saved and loaded from files. Refer to the provided examples to
see the detailed structure of the limits file.
Remember that portfolio optimizations must be run again in order to consider any change made to the
investment limits (or groups).
36
OptiFolio
USER'S GUIDE
Limit to individual asset turnover. The limit will be compared to the maximum asset-wise
difference in weights between the candidate portfolio and the reference portfolio. In other words,
the maximum allowable absolute weight difference in any asset will be the entered percentage.
Limit to total asset turnover. The limit will be compared to the sum of asset-wise differences in
weights between the candidate portfolio and the reference portfolio. In other words, the total
weight differences along the portfolio will not exceed the entered percentage.
37
OptiFolio
USER'S GUIDE
38
OptiFolio
USER'S GUIDE
The Portfolio composition tab shows the portfolio weights in graphic and tabular form. The table report
may be edited by the user in order to set new weights for the assets. This tab also presents the portfolio
composition by asset groups.
39
OptiFolio
USER'S GUIDE
40
OptiFolio
USER'S GUIDE
In the Return statistics tab, the user can access relevant information regarding each portfolio, such as the
expected return, Sharpe ratio, CVaR, etc.
As a reference, the CVaR is presented using the non-parametric method described in a previous section
and also under a normal distribution assumption (i.e. assuming that instead of calculating the adjusted
vector return percentiles, the critical value can be estimated based on a normal distribution with the same
mean and standard deviation in comparison to the vector of adjusted returns).
The Limit status tab presents a summary of the limits compliance for each portfolio. The status of each
limit is clearly labeled on the last column.
41
OptiFolio
USER'S GUIDE
Finally, the Monte Carlo Simulation tab allows the user to conduct a Monte Carlo Simulation on the
forecasted value of the portfolio. For this purpose, the current value of the portfolio is assumed to be 100.
42
OptiFolio
USER'S GUIDE
After pressing the Forecast button, a forecasted return matrix is generated (containing as many random
scenarios as is configured on the Parameters window) using random numbers from a multivariate
elliptical copula that combines the distributions for each asset. This copula considers the inter-variable
correlations as well as the individual parameters. For each possible returns scenario, a value path is
calculated. Once all value paths have been estimated, a chart showing the median value and critical
percentiles (1%, 5%, 95%, and 99%) is shown. The chart will go as far as indicated by the Horizon value
(in working days).
The results of the chart may also be found in tabular form on the Price simulation table tab.
The Copy paths button will copy the detail of each of the simulated value paths. Note that the amount
of information copied to the clipboard may be considerable depending on the number of requested
scenarios and the horizon of the simulation.
43