0% found this document useful (0 votes)
14 views76 pages

Optifolio UsersGuide EN

Uploaded by

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

Optifolio UsersGuide EN

Uploaded by

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

OptiFolio

User's Guide

Portfolio Analysis and Optimization

Copyright ® Risk-Solutions, LLC


Document updated: 2020.05
Company
LOGO

OptiFolio
Portfolio Analysis and Optimization
OptiFolio - User's Guide

Contents

I. Overview ________________________________________________________________ 1
II. Importing data and configuring OptiFolio _____________________________________ 8
II.1. Importing market prices from the web __________________________________________ 8
II.2. Configuring web data sources in the session file___________________________________ 9
II.2.1. The Data Sources sheet _____________________________________________________________ 9
II.2.2. The Assets universe sheet __________________________________________________________ 10
II.2.3. The Parameters sheet _____________________________________________________________ 11
II.3. Configuring historical prices in an MS Excel® worksheet ___________________________ 11
II.4. Importing market prices from MS Excel® or delimited files _________________________ 12
II.5. Parameters configuration ____________________________________________________ 13
III. The Data Manager ______________________________________________________ 15
III.1. Asset prices, returns, and statistics____________________________________________ 15
III.1.1. Historical prices _________________________________________________________________ 15
III.1.1. Price discontinuities ______________________________________________________________ 16
III.1.2. Asset returns ___________________________________________________________________ 18
III.1.3. Return statistics _________________________________________________________________ 20
(1) Editing assumptions ______________________________________________________________ 20
(2) Positive definiteness ______________________________________________________________ 22
III.1.4. Adjusted returns _________________________________________________________________ 23

III.2. Transaction costs __________________________________________________________ 23


III.3. Returns best-fit ___________________________________________________________ 24
III.4. Monte Carlo Simulation for individual assets ___________________________________ 25
IV. Portfolio optimization ____________________________________________________ 27
IV.1. Feasible investment area based on exhaustive portfolio combinations_______________ 27
IV.2. Feasible investment area based on a Stochastic-Genetic model ____________________ 28
IV.3. The Conditional VaR (CVaR)/Expected Return model _____________________________ 29
IV.4. Optimum portfolio weights _________________________________________________ 30
IV.5. Efficient frontier __________________________________________________________ 31
IV.5.1. Tabular frontier _________________________________________________________________ 31
IV.5.2. Graphic frontier _________________________________________________________________ 32
IV.5.3. Strategic statistics _______________________________________________________________ 33

IV.6. Interactive portfolio navigation and selection on the efficient frontier _______________ 37
IV.7. Interactive experiment with a simple portfolio of three assets _____________________ 39
IV.7.1. Experimenting with the diversification effect __________________________________________ 39
OptiFolio - User's Guide

IV.7.2. Experimenting with two assets: VaR and CVaR features _________________________________ 41
IV.7.3. Experimenting with three assets: VaR and CVaR features ________________________________ 42

V. GROUPS AND LIMITS _____________________________________________________ 45


V.1. Asset groups ______________________________________________________________ 45
V.2. Investment limits __________________________________________________________ 46
V.3. Portfolio benchmarks _______________________________________________________ 48
V.3.1. Assets turnover __________________________________________________________________ 48
V.3.2. Risk and Return limits _____________________________________________________________ 49

V.4. Asset limits report _________________________________________________________ 49


VI. The Portfolio Manager ___________________________________________________ 51
VI.1. Portfolio composition ______________________________________________________ 51
VI.2. Return statistics ___________________________________________________________ 53
VI.3. Portfolio back-testing ______________________________________________________ 55
VI.4. Limit status ______________________________________________________________ 57
VI.5. Monte-Carlo Simulation ____________________________________________________ 58
VI.6. Portfolio Performance-Attribution ____________________________________________ 59
VII. Risk Mapping __________________________________________________________ 62
VII.1. Defining Risk Factors ______________________________________________________ 62
VII.2. Mapping risk factors to assets _______________________________________________ 64
VII.3. Editing assumptions _______________________________________________________ 64
VIII. User Views ____________________________________________________________ 68
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,
automatically importing market data from the web from multiple sources. 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.
Here we present a compact version of a typical OptiFolio session.

■ Load historical prices data from the web, from multiple sources (Yahoo®, End-of-day
Historical Data, Quandl and others), as well as from MS Excel® documents and delimited
files.

Fig.1: Importing data from the web

■ All your session data (including assets, portfolios, asset groups, constraints, assumptions,
user views and data sources) are automatically saved in Session files (which are editable
MS Excel® files, by the way).

1
OptiFolio - User's Guide

■ The historical prices for your assets are automatically updated by the software from the
configured web sources.

OptiFolio automatically calculates and displays:


■ Historical prices charts and tables for each asset.
■ Historical returns according to the holding period configured by the user.
■ Various return statistics, such as mean returns, covariances, and correlations, which can
be calculated from data, pasted from the clipboard, or manually edited.
■ The Best-fit for each variable (to a statistical distribution).
■ The Monte Carlo Simulation, which forecasts the future performance for each asset.

Fig.2: Historical prices graph

■ Optimize portfolios with Markowitz-Sharpe or Return/Conditional VaR charts. OptiFolio


depicts all feasible portfolios on the Risk/Return or CVaR/Return plane using either
exhaustive combinations or a stochastic combinations model.

2
OptiFolio - User's Guide

Fig.3: Markowitz-Sharpe chart

■ 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.

Fig.4: Efficient frontier - Graphic format

3
OptiFolio - User's Guide

Fig.5: Efficient frontier - Tabular format

■ OptiFolio allows the user to define asset groups and limits for the portfolio. Groups and
limits are also stored in human readable files.

Fig.6: Asset groups

■ This is an example of a feasible investment area including constraints.

4
OptiFolio - User's Guide

Fig.7: Markowitz-Sharpe chart with restrictions

■ 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.

Fig.8: Markowitz-Sharpe chart with constraints - Interactive efficient frontier

5
OptiFolio - User's Guide

■ Manage user-defined portfolios, calculate statistics, and conduct Monte Carlo Simulations.

Fig.9: Portfolio Manager window

■ OptiFolio allows the user to define the risk factors, such as interest rates and exchange
rate, which determine the returns of the assets included in the portfolio. This toolbox
automatically calculates the expected returns, the covariance and correlation matrixes
based on the risk factors.

Fig.10: Mapping matrix from Risk Factors to Assets

6
OptiFolio - User's Guide

■ OptiFolio can also calculate the expected returns based on the Black-Litterman model from
just the perspectives of the user about the future returns of the assets included in the
portfolio.

Fig.11: Expected returns from the Black-Litterman model

■ Finally, the user can save his session in an MS Excel® file with all the data (data sources,
assets information, prices, covariance matrix, expected returns, risk factors, mapping
matrix from risk factors to assets, asset groups, investment limits, portfolios and user
views) used in OptiFolio. The next time the application is opened, OptiFolio will load the
built-in session file, restore all data structures and ask the user

7
OptiFolio - User's Guide

II. Importing data and


configuring OptiFolio
II.1. IMPORTING MARKET PRICES FROM THE WEB
Prices can be downloaded from many REST-compatible web sources, including Yahoo®,
Quandl® and End-of-Day historical Data®. You can manually configure any number of data
sources and mix them.
Use the “Load prices from the web” button to access this screen, which shows the assets to be
downloaded. Notice that each asset can be associated to a different data source. Only the checked
assets will be considered during the download process.

Fig.12: Load prices from the web

8
OptiFolio - User's Guide

Once all the assets that are going to be included in the portfolio have been selected, as well as the
time period for the prices, proceed to download the database using the “Download prices” button.
If the current dataset matches the requested assets (by names), then the “Clear portfolios, groups
and limits” option will be enabled. If left unchecked, only the prices will be updated and no other
objects will be changed.
OptiFolio will show a window that resumes the availability of the prices for each asset.

Fig.13: Check the availability of the assets

Each row indicates the starting (“Available from”) and final (“Available to”) date, in the selected
range of sample, when the prices of the assets are available and the total number of points. In case
one of the assets is not available for the period requested, which can be identified when the
number of points is equal to 0, it will be needed to disable its importation to make a satisfactory
download of the remaining assets prices.

II.2. CONFIGURING WEB DATA SOURCES IN THE SESSION FILE


Optifolio sessions are saved in session files, which are MS Excel® documents with a certain
worksheet structure (identified by the sheet names). For your convenience, there is an
automatically saved and loaded session file (named “session.xlsx”) located in the root folder of the
application. However, you can create, use and share your own session files. These documents are
editable, so you can open them and change their content using a worksheet application.

II.2.1. The Data Sources sheet

Here you have an example of one session document:

9
OptiFolio - User's Guide

Fig.14: The Session.xlsx file structure – Data Sources

The “Data Sources” sheet contains the access details of the configured data sources. The columns
contain the Source ID and name (you decide both of them), the type (should be “WEB”), the base
URL (do not include the https prefix, it is automatically inserted; http is not accepted), the UserID (if
needed), the UserKey (if needed), the position of the dates column, the position of the prices
column and the request string (this URL is added to the base URL in order to build the final query
URL).
The Request string contains several auto-replaceable tokens:
%ASSETID ........................... Asset symbol or ID
%ASSETNAME ..................... Asset name
%ASSETINTERNALNAME ..... Asset internal name
%APIKEY ............................. UserKey
%USERID ............................. UserID
%DATEYMD0 ....................... Initial date in YMD format
%DATEYMD1 ....................... Ending date in YMD format
%UNIXDATEYMD0................ Initial date in Unix format
%UNIXDATEYMD1................ Ending date in Unix format
%FREQ ................................ Frequency indicator letter (‘d’ for daily, ‘w’ for weekly)
The web service is expected to return the information in comma-separated format.

II.2.2. The Assets universe sheet

The “Assets universe” sheet contains the list of all assets of interest for the user.

Fig.15: The Session.xlsx file structure – Assets universe

10
OptiFolio - User's Guide

The columns contain the Asset name (this is the unique identifier of the asset), the asset ID (this is
the ID for the web data source), the SourceID, the import mark (only assets marked with an “X” will
be imported), and optional comments.
Notice that the same asset may appear in more than one row, with different data sources. This
allows you to easily switch from one data source to another.

II.2.3. The Parameters sheet

This worksheet contain basic working parameters, such as the annual risk-free rate, the holding
period (in working days) and the sample size (in working days). This sample size is used for
importing historical data from the web.

Fig.16: The Session.xlsx file structure – Parameters

II.3. CONFIGURING HISTORICAL PRICES IN AN MS EXCEL®


WORKSHEET

The structure of the historical data matrix in MS Excel® should be as follows:


■ 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.
■ There should be no empty cells inside the data matrix.

11
OptiFolio - User's Guide

Fig.17: Configuring data in MS Excel®

II.4. IMPORTING MARKET PRICES FROM MS EXCEL® OR


DELIMITED FILES

In order to import data from MS Excel®, use the “Load prices from XLS file” button on the ribbon.
Then select the MS Excel® file containing the historical prices data.

Fig.18: Main Ribbon

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 or Tab-Delimited) should be used instead of an MS Excel®
formatted file.

12
OptiFolio - User's Guide

II.5. PARAMETERS CONFIGURATION


The “Configure Parameters” button gives you access to the following parameters:

Fig.19: Parameters configuration

■ 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.
■ Number of days per year
All returns will be calculated using the Holding-Period entered by the user inside the Data
Manager. However, when an annual figure is required, OptiFolio will use this assumed
number of days per year (DPY). For example, a daily risk-free rate would be calculated as:
1

(1 + YearlyRFR ) DPY − 1

■ CVaR Significance level


This rate is used to calculate the Conditional VaR. Usual values are 1% and 5%.
■ Number of simulated paths
This is the number of simulated price paths for the Monte Carlo analysis.
■ Show individual assets
If this option is checked, individual asset marks will be added to the Risk/Return charts.

13
OptiFolio - User's Guide

■ 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.

14
OptiFolio - User's Guide

III. The Data Manager


III.1. ASSET PRICES, RETURNS, AND STATISTICS
III.1.1. Historical prices

Use the “Data Manager” to browse, edit, and produce information about prices, returns, general
statistics, and a Monte Carlo Simulation for asset prices. Additionally, it is possible to configure the
transaction costs (as a percentage of the position) incurred when buying or selling assets. These
will be implemented in the back-testing analysis of the desired portfolio.
Enter the “Historical prices” tab to get time series charts for each asset and enter the “Historical
prices table” tab to get the assets list with each price point of the chart. Both the chart and table
may be copied to the clipboard by right-clicking on them.

Fig.20: Historical prices graph

To zoom in on a section of a chart, left click and drag the mouse pointer making a diagonal from
left to right. To return to the default zoom level, click and drag the pointer making a diagonal from
right to left.

15
OptiFolio - User's Guide

III.1.1. Price discontinuities

There are certain events related to stocks where the nominal price of a stock changes abruptly but
no real effects are produced on the returns (the most common examples are dividend flows and
stock splits). When discontinuities are present, it is not advisable to use the raw prices to generate
historical returns. The prices must be adjusted first in order to suppress the breakpoints and work
with a "continuous" data series. The following example shows a typical scenario where a stock
split changed the nominal price of the security.

Fig.21: Example of a discontinuous price series

OptiFolio allows the user to detect price discontinuities and fix them by using a backward price
adjustment algorithm.
In order to examine all asset data and look for breakpoints, enter the 'Price discontinuities' tab,
configure a maximum daily change threshold and press the 'List breakpoints button'.

16
OptiFolio - User's Guide

Fig.22: Price discontinuity detection

Press the 'Adjust data' button to run the price adjustment algorithm. Consider that for each
breakpoint, the data will lose one point (at date 'T0'). This is the adjusted data series from the
previous example:

Fig.23: Price series after adjusting for breakpoints

17
OptiFolio - User's Guide

III.1.2. Asset returns

The asset returns tab shows three important parameters for the analysis:
■ Holding period (in working days)
All internal return calculations will be carried out for a time span equal to the holding period.
In other words, all returns, mean returns, and covariances will be expressed for the holding
period (see example below).

Fig.24: Asset returns tab

■ Price comparison distance and unit


When calculating returns from prices, each return will be calculated by comparing two
prices: an initial price and an ending price. This parameter controls the distance between
each pair or prices used to calculate returns. The distance may be measured in working
days or in physical observations (see example below).
■ Return calculation technique
Returns may be calculated using geometric or logarithmic returns. The geometric formula
for the return (r) is the following, considering the prices (P), the comparison distance (L),
the Holding Period (HP), and the working days distance between the compared prices (ΔT).
HP
Pt
rt = ( ) T − 1
Pt − L

18
OptiFolio - User's Guide

While the logarithmic version is the following:


Pt HP
rt = Ln ( )
Pt − L T

■ Overlapping observations
The return calculation can be done with all the observations in the sample (“Overlapping”)
or just considering the observations that maintain an arbitrary distance with the last
observation (“Non-overlapping”).

The advantage of working with the entire sample is that the number of observations is
considerably larger; nonetheless, high levels of autocorrelation are introduced in the
calculation of the returns.

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


Let’s assume that the first loaded prices correspond to the following dates:
February 1st, 2nd, and4th.Assume that the Holding Period is three working days, the
price comparison distance is one physical observation, and the calculation
technique is geometric.
The first return would be calculated comparing Feb 2nd vs. Feb 1st (one physical
observation apart, one working day apart in this case) and would express the result
for three working days, as follows:
3
P Feb 2
r Feb 2
= ( )1 − 1
P Feb 1

The second return would be calculated comparing Feb 4th vs. Feb 2nd (one physical
observation apart, two working days apart in this case) and would express the
result for three working days, as follows:
3
P Feb 4
r Feb 4
= ( )2 −1
P Feb 2

19
OptiFolio - User's Guide

III.1.3. Return statistics

In the “Return statistics” tab, OptiFolio shows the (1) expected returns, (2) return covariances, (3)
return correlations, and (4) statistics summary of the returns.

Fig.25: Return statistics: Historical and Expected

The “Expected 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.

(1) Editing assumptions

By default, statistics are calculated from the historical returns. If you change the values for the
assumed statistics and want to restore historical values, simply press the “Assume historical”
button.
If, instead of typing, you prefer to paste assumptions from an external matrix, use the “Paste
values” button.

20
OptiFolio - User's Guide

The “Assume independency” button is used to assume zero correlations (and covariances) among
assets. Only variances will be taken into consideration under this scenario
For instance, in this chart the correlation between assets 1 and 3 is 0.5166. If this correlation is
manually changed to, say, 0.2, the diversification power between this pair of assets will increase
and the feasible investment area will expand to the left, as shown in the next figure.

Fig.26: Chart with high correlation between assets 1 and 3

Fig.27: Chart with lower correlation between assets 1 and 3

21
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.

Fig.28: Chart with negative correlation between assets 1 and 3

(2) Positive definiteness

The positive definiteness of the covariance matrix is evaluated each time a correlation or
covariance assumption is changed. A positive definite matrix exhibits a green label on the upper
right corner, as shown below. Otherwise, a red warning will appear at the same place.

Fig.29: Return covariances

22
OptiFolio - User's Guide

III.1.4. Adjusted returns

The Adjusted returns matrix shown on the “Asset Returns” tab contains a transformation of the
historical returns. This transformed return series is calculated in such a way that:
■ 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:
X t − Mean(X )
A t
= ( Hist
)σX + E(X) Target
σX
Target

Hist

Fig.30: Adjusted returns

III.2. TRANSACTION COSTS


The transaction costs are the expenses incurred when buying or selling assets in the secondary
market, and therefore these result important when doing a back-testing analysis. OptiFolio allows
to define them as a percentage of the position in one particular asset and be able to differentiate the

23
OptiFolio - User's Guide

expenses incurred from buys or sells. Additionally, it can be established as a fixed percentage for
all the assets and independently of the kind of transaction with the “Assume all equal to:” button.

Fig.31: Transaction costs

III.3. RETURNS BEST-FIT


“Best-fit” means finding the optimal distribution to represent a certain dataset. In this case, the
datasets are the historical returns for each asset. This analysis is always carried out assuming a 1-
day holding period, because the 1-day returns will be later linked and compounded in order to
forecast the asset performance for longer terms.
Each row shows the best distribution for each asset, together with the best parameters for the
distribution. OptiFolio considers two possible distributions: Normal and Student’s-t. The Anderson-
Darling (AD) is also shown on the table. AD values lower than 0.75 indicate that the distribution is
a suitable candidate 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.

24
OptiFolio - User's Guide

Fig.32: Best-fit results

III.4. MONTE CARLO SIMULATION FOR INDIVIDUAL ASSETS


The Monte Carlo Simulation is processed using the best-fitted distributions for each asset.
In this tab, after pressing the “Forecast” button, a series of forecasted return vectors are generated
(as many as were configured on the Parameters window) using random numbers from the
corresponding distribution. For each possible returns vector, 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).

25
OptiFolio - User's Guide

Fig.33: Monte Carlo Simulation for one asset

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.

26
OptiFolio - User's Guide

IV. Portfolio optimization


In order to create Markowitz-Sharpe or Return/Conditional VaR charts, click on the “Portfolio
optimization” button on the Main Ribbon. There are two chart types (models) and two
methodologies to depict all feasible portfolios on the Risk/Return plane:
■ Chart types: Markowitz-Sharpe Model and Expected Return/Conditional VaR model.
Additionally, it is possible to plot only the Markowitz-Sharpe feasible area border in order to
avoid the calculation of the feasible area interior and reduce the computation time.
■ Portfolio simulation methods: exhaustive combinations and Stochastic-Genetic method.

IV.1. FEASIBLE INVESTMENT AREA BASED ON EXHAUSTIVE


PORTFOLIO COMBINATIONS

The first methodology used to draw the complete profile of the feasible area examines alternative
portfolios formed using a systematic rule to distribute weights uniformly.
For instance, given two assets, all portfolios (0%, 100%), (1%, 99%)…(99%, 1%), and (100%, 0%)
would be included on the chart. The level of detail would increase as the simulation advances.
Therefore, on a “second pass,” portfolios (0.1%, 99.9%), (0.2%, 99.8%), and so on would be
tested.
Press the “Start” button to begin analyzing feasible portfolios. The simulation can reach speeds of
several million portfolios per second. Therefore, the chart and especially the efficient frontier should
adopt a defined shape rapidly. Press the “Stop” button once you are satisfied with the level of detail.
Note that the chart generation will not end automatically.

27
OptiFolio - User's Guide

Fig.34: Markowitz-Sharpe chart with exhaustive combinations method

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.

IV.2. FEASIBLE INVESTMENT AREA BASED ON A STOCHASTIC-


GENETIC MODEL
The second methodology used to draw the complete profile of the feasible area examines
alternative portfolios formed using random weights (assuming long positions for all assets). The
random distribution that generates these weights has been specially calibrated in order to explore
as much as possible the feasible investment area (not only the “central” part, but also the
“extremes”).
This particular kind of simulation shows the internal structure of the chart, composed by several
simpler feasible areas and curves that arise from combinations of two, three, and more assets.
Again, the color shows the relative density of portfolios on the chart.

28
OptiFolio - User's Guide

Fig.35: Markowitz-Sharpe chart with Stochastic-Genetic model

IV.3. THE CONDITIONAL VAR (CVAR)/EXPECTED RETURN


MODEL

In the Markowitz model, the portfolio (risk, return) coordinates are calculated using the Expected
Standard Deviation and Expected return for the portfolio (horizontal and vertical, respectively). The
formula is:
n n n

[ E ( Risk p
), E (Re turn p
)] = [ E (  p
), E ( r p )] = [  w j  w k  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.

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 ( R p ,  ) = Percentile ( , R p )

29
OptiFolio - User's Guide

Hence, the Conditional Value-at-Risk of the vector will be:

 Rp
R p  VaR ( R P , )
CVaR ( R p ,  ) =
1
R p  VaR ( R P , )

The portfolio coordinates for the CVaR/Return model will then be:
n

[ E ( Risk p
), E (Re turn p
)] = [ E ( CVaR p
), E ( r p )] = [ CVaR ( w  AR ,  ),  w j  E (r j )]
j =1

This is an example of the CVaR/Return chart.

Fig.36: Return/Conditional VaR chart with exhaustive combinations method

IV.4. OPTIMUM PORTFOLIO WEIGHTS


Once the user finishes the simulation, the optimum portfolio weights can be reviewed on the
second tab. Weights for both minimum standard deviation portfolio and maximum Sharpe ratio are
shown for the Markowitz-Sharpe chart, and minimum CVaR and maximum Expected Return/CVaR
are shown for the Return/Conditional VaR.

30
OptiFolio - User's Guide

Fig.37: Portfolio optimization weights

OptiFolio has the option to save these portfolios to the Portfolio Manager by using the buttons
located on the blue options bar.

IV.5. EFFICIENT FRONTIER


The last tab shows the detailed composition of the portfolios located on the efficient frontier. Select
the desired number of portfolios and OptiFolio will split the frontier into the corresponding number
of nodes.

IV.5.1. Tabular frontier

The first four columns of the table show the basic statistics for each portfolio, while the rest of
columns exhibit the asset weights needed to reach that point.
You may copy the table to the clipboard by right-clicking on it. You can also add specific frontier
portfolios to the Portfolio Manager by right-clicking on them.

31
OptiFolio - User's Guide

Fig.38: Efficient frontier results

IV.5.2. Graphic frontier

The graphic representation of the frontier shows the weights of the portfolios along the frontier.
From left to right, the portfolios increase in terms of total risk.

Fig.39: Efficient frontier results

32
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.

IV.5.3. Strategic statistics

The graphic representation of the strategic statistics of the frontier portfolios show how the
statistics change as the portfolios increase in terms of total risk from left to right. The statistics you
can observe are:
■ Sharpe Ratio
■ Investor utility (Low Risk Tolerance)
■ Investor utility (Medium Risk Tolerance)
■ Investor utility (High Risk Tolerance)
■ Keating’s Omega

Fig.40: Efficient frontier results – Sharpe Ratio

33
OptiFolio - User's Guide

Fig.41: Efficient frontier results – Investor utility (Low Risk Tolerance)

Fig.42: Efficient frontier results – Investor utility (Medium Risk Tolerance)

34
OptiFolio - User's Guide

Fig.43: Efficient frontier results – Investor utility (High Risk Tolerance)

Fig.44: Efficient frontier results – Keating’s Omega

35
OptiFolio - User's Guide

Fig. 45: Efficient frontier results – Herfindahl-Hirschman Index

Fig. 46: Efficient frontier results – Conditional-Var @ 5%

As well as in the previous case, you can choose the number of portfolios to be shown for the
graphic display of the strategic statistics.

36
OptiFolio - User's Guide

IV.6. INTERACTIVE PORTFOLIO NAVIGATION AND SELECTION ON


THE EFFICIENT FRONTIER

Once the drawing sequence has been finished, move the mouse over any frontier portfolio and
OptiFolio will show a floating window containing the following information: (1) the three assets
with the highest weights in the portfolio, (2) a pie chart showing the relative weights of those three
assets (sorted), as well as the rest of the portfolio, and (3) the key Risk and Return statistics for
the selected portfolio.

Fig.47: Efficient frontier results

37
OptiFolio - User's Guide

Fig.48: Efficient frontier results

Any frontier portfolio can be saved to the Portfolio Manager for further analysis by double-clicking
onto it.

38
OptiFolio - User's Guide

Fig.49: Saved portfolio in the Portfolio Manager

You can also hover the mouse over any pure asset to see its name and coordinates.

Fig.50: Pure asset information

IV.7. INTERACTIVE EXPERIMENT WITH A SIMPLE PORTFOLIO OF


THREE ASSETS

This module allows you to interactively play with generic three-assets portfolios in order to
demonstrate some of the features of the Mean-Variance and the CVaR models.

IV.7.1. Experimenting with the diversification effect

You can use this chart as a simple aid to give an academic explanation of how the diversification
works. The chart shows three pure assets and their intermediate portfolios on the Expected Return
(vertical axis) and Expected Standard Deviation (horizontal axis) plane. The assets coordinates and
inter-asset correlations can be adjusted by the user. However, remember that this simulation only
takes into account the pair-wise diversification effects; the three-assets efficient frontier is probably
closer to left side of the graphic.
The default chart shows three assets located at risk-return combinations given by coordinates
(10%, 5%), (17%, 24%) and (20%, 12%) respectively. Inter-asset correlations are initially set at 1.0,
so there are no diversification effects and asset 3 is dominated by some combinations of 1 and 2.

39
OptiFolio - User's Guide

Fig.51: Experimenting - Default asset locations and correlations (no diversification)

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'.

Fig.52: Experimenting - New asset locations and correlations (high diversification)

40
OptiFolio - User's Guide

IV.7.2. Experimenting with two assets: VaR and CVaR features

The VaR and CVaR values behave very differently when confronted with progressive portfolio
rebalancing. This can be seen very clearly in the following charts, that show the VaR and CVaR
results for a portfolio with two assets when the weight of the first asset is assumed to change from
0% to 100% in small intervals. In this example, the VaR shows several local minima and no clear
global minimum.

Fig.53: Experimenting - VaR for different combinations of two assets

In contrast, CVaR shows a well behaved pattern with a unique minimum.

41
OptiFolio - User's Guide

Fig.54: Experimenting - VaR vs CVaR for different combinations of two assets

IV.7.3. Experimenting with three assets: VaR and CVaR features

The previous experiment can be easily extended to a three-assets portfolio, as shown below.

Fig.55: Experimenting - VaR surface for different combinations of three assets

42
OptiFolio - User's Guide

CVaR exhibits a smooth surface with one global optimum point, contrasting the chaotic surface of
the VaR statistic.

Fig.56: Experimenting - CVaR surface for different combinations of three assets

43
OptiFolio - User's Guide

Fig.57: Experimenting - VaR surface for different combinations of three assets

Fig.58: Experimenting - CVaR surface for different combinations of three assets

44
OptiFolio - User's Guide

V. GROUPS AND LIMITS


Press the “Groups and limits” button in order to configure different asset groups and limits for the
portfolio.

V.1. ASSET GROUPS


In the first tab, asset categories and groups can be constructed by clicking on the “New category”
or “New group” button and choosing each one of the assets for the portfolio. To keep any changes
to the group, click on the “Keep changes” button after creating it.
Take into account that categories are just helpers used to organize groups. Categories do not have
any special meaning for the optimization process. You may work with only one group category if
you prefer.

Fig.59: Asset groups

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:

45
OptiFolio - User's Guide

Fig.60: Asset groups source file

Here you can see an example of the simple internal structure of these files.

Fig.61: Asset groups in MS Excel®

V.2. INVESTMENT LIMITS


In the second tab, investment limits (also known as position constraints) can be implemented. The
limits can also be arranged into categories like the Asset groups.
Limits can be defined with great flexibility, using the parameters explained below. To confirm any
change made to a limit, click on the “Keep changes” button.

46
OptiFolio - User's Guide

Fig.62: Investment limits

The various limit parameters are:


■ Limit target kind
A limit can be applied to the position of an asset group (as a whole), to the weight of every asset in
a group, or to a single asset.
■ Limit target object
Select the limited object (group or asset) on the first drop-down list
■ Limit sign
Select the limit sign (<= or >=) on the second drop-down list
■ Weight or comparison value
Enter the limit weight or the referred comparison weight (of another asset or group).
■ 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.

47
OptiFolio - User's Guide

Remember that portfolio optimizations must be run again in order to consider any change made to
the investment limits (or groups).

Fig.63: Markowitz-Sharpe chart with exhaustive combinations method with constraints

V.3. PORTFOLIO BENCHMARKS


This form allows you to set additional constraints to the portfolio related to asset turnover and
global risk statistics.

V.3.1. Assets turnover

By using this feature, you can select a reference portfolio (the drop-down list will show all
portfolios that appear in the Portfolio Manager). The limit will be referred to as the difference in
absolute weights between the feasible portfolio and the reference portfolio. Differences can be
measures either individually or in total:

• 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.

48
OptiFolio - User's Guide

Fig.64: Portfolio benchmarks configuration

V.3.2. Risk and Return limits

By enabling this feature, the feasible portfolios will be confined to a certain region of minimum and
maximum expected return and risk. The risk measure will depend on the current model: either
Standard Deviation or Conditional Value-at-Risk.

V.4. ASSET LIMITS REPORT


This report shows the effective limits associated to each asset as far as can be statically deduced
from the limit structure. This table provides relevant information regarding the “intersection” of
limits. However, it is not possible to evaluate the impact of all limits in advance (consider, for
example, a group limit referred to the weight of another group).

49
OptiFolio - User's Guide

Fig.65: Asset limits report

50
OptiFolio - User's Guide

VI. The Portfolio


Manager
The Portfolio Manager allows the user to create and manage specific portfolios for further analysis.
Custom portfolios may have user-defined weights. Portfolios can be saved or loaded from data
files in a similar fashion to asset groups and limits. Please refer to the provided examples in order
to see the detailed structure of the portfolio files.

VI.1. PORTFOLIO COMPOSITION

Fig.66: Portfolio Manager - Composition report

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.

51
OptiFolio - User's Guide

Fig.67: Portfolio Manager - Composition table

Fig.68: Portfolio Manager - Composition by asset group

52
OptiFolio - User's Guide

Fig.69: Portfolio Manager – Contribution VaR

VI.2. RETURN STATISTICS


In the Return statistics tab, the user can access relevant information regarding each portfolio. The
first group of statistics presents the expected return, Sharpe ratio, CVaR, etc; calculated using the
same frequency and methodology selected in “Data Manager” and for annual returns.
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).
Instead, the second group of statistics are developed under the assumption that the selected
portfolio equals the market portfolio. Under the Black equilibrium model is possible to calculate the
expected equilibrium returns using a risk-aversion factor of the market, which can be selected from
the list that is placed at the bottom of the window. These returns are also presented with simple
and compounded annualization.

53
OptiFolio - User's Guide

Fig.70: Portfolio statistics

Fig. 71: Expected returns under Black equilibrium model

54
OptiFolio - User's Guide

VI.3. PORTFOLIO BACK-TESTING


The Back-testing tab shows the simulated values of the portfolio assuming that certain weights are
maintained through the entire analyzed time span. These weights can be:
■ Constant Qs: with the weights that were valid in the first day of analysis (t=0)
■ Constant Qs: with the weights that were valid in the last day of analysis (t=T)
■ Constant Ws: with the prices from t-1 without transaction costs
■ Constant Ws: with the prices from t-1 with transaction costs

Fig.72: Portfolio back-testing (Ws valid in t=0)

55
OptiFolio - User's Guide

Fig.73: Portfolio back-testing (Ws valid in t=T)

Fig.74: Portfolio back-testing (prices valid in t-1) without transaction costs

56
OptiFolio - User's Guide

Fig. 75: Portfolio back-testing (prices valid in t-1) with transaction costs

VI.4. LIMIT STATUS


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.

57
OptiFolio - User's Guide

Fig.76: Portfolio limit status

VI.5. MONTE-CARLO SIMULATION


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.

58
OptiFolio - User's Guide

Fig.77: Portfolio Manager window - Monte Carlo Simulation

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, or as
a chart with all the simulated paths on the “Overlaid forecasts” 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.

VI.6. PORTFOLIO PERFORMANCE-ATTRIBUTION


The Performance attribution tab allows you to examine the active performance of the portfolio
compared to a benchmark portfolio according to the Brinson model. This comparison can be made
within groups in the same category and it is shown in detailed and in a graphic summary:

59
OptiFolio - User's Guide

Fig.78: Portfolio Manager window – Performance attribution (detailed results by region)

Fig.79: Portfolio Manager window – Performance attribution (graphic summary by region)

60
OptiFolio - User's Guide

Fig.80: Portfolio Manager window – Performance attribution (detailed results by industry)

Fig.81: Portfolio Manager window – Performance attribution (graphic summary by industry)

61
OptiFolio - User's Guide

VII. Risk Mapping


VII.1. DEFINING RISK FACTORS
Portfolio optimization analysis can be extended if risk factors are introduced, such as interest rates,
market indexes and exchange rate; which are fundamental for the inclusion of bonds or illiquid
assets in the portfolio. To add risk factors, click the “Risk Mapping” button in the Main Ribbon.

Fig.82: Historical data of risk factors

In order to include the risk factors for further analysis, first load in the tab “Define Risk Factors” its
historical data for the same period that was set for the assets prices. Using the button “Load Risk
Factors”, a floating window will allow the selection of an MS Excel® file that contains this
information with the same structure that is used to import the asset prices. This file can include the
values of market indexes for shares, and, if bonds have been included, the interest rates that are
relevant. In the same way, if there are assets denominated in foreign currency, then it should also
include the historical values of the exchange rate (base currency divided by foreign currency). For
those assets that do not have any risk factor, excluding the exchange rate, they must be included in
the file with the same historical prices to avoid errors in the estimation of the expected values.

62
OptiFolio - User's Guide

Fig.83: Risk Factor classification

Next, in the “Risk Factor classification” tab, the risk factors that should be analyzed using
arithmetic changes (usually the variables that are in percentages such as interest rates) must be
selected. OptiFolio automatically selects the factors that are identified with a name that starts with
“RATE_”. To confirm that the risk factors are correctly classified, use the “Keep changes” button.
The “Detailed Returns” tab includes a table with the risk factors returns considering the previous
setup and the configuration used in “Data Manager” for its calculation.

63
OptiFolio - User's Guide

VII.2. MAPPING RISK FACTORS TO ASSETS

Fig.84: Mapping matrix from Risk Factors to Assets

The “Map Risk Factors to Assets” tab has matrix in which each row represents an asset included
in the portfolio and each column represents a risk factor. This matrix has to be filled with the
sensibility that has one assets against a particular risk factor measured as the impact that has 1%
change in the risk factor over the return in the asset. Therefore, the shares should have a
coefficient equal to the beta calculated from a linear estimation against a group of indexes. Bonds,
in the other hand, will have a coefficient with the interests rates equal to their Key Rate Durations.
Lastly, the assets that are denominated in other currencies should have a coefficient equal to 1
with the exchange rate that applies. It is important to remember that sometimes is necessary to
include as factors the historical prices for a group of assets as mentioned before. All of them must
also have a coefficient equal to 1 with its counterpart in the rows of assets.
OptiFolio uses colors to identify visually the relationship between the assets and its risk factors. A
green box will represent a positive coefficient, red when is negative, white when it is equal to 0 and
yellow when it is equal to 1.

VII.3. EDITING ASSUMPTIONS


Risk factor’s assumed statistics for the expected return and covariances can be edited in the same
way as assets assumptions.

64
OptiFolio - User's Guide

Fig.85: Editing Risk Factors Assumptions

Expected asset returns will be calculated considering two components:


▪ The product of the mapping matrix and the expected returns of the risk factors and
▪ The vector of constant yields associated to individual assets
Constant yields correspond to the level of returns that only depend on the passage of time and are
not affected by changes in risk factors (e.g. the current yield-to-maturity of bonds).
The next window allows you to enter the assumptions for the constant yield of assets. These
values should be entered as annual yields and will be later converted to holding period yields to be
added to the vector of expected asset returns.

65
OptiFolio - User's Guide

Fig.86: Configuring additional constant yields for assets

To finish, press the “Estimate asset statistics” button. This will update the mean and variance of
the expected asset returns as function of its risk factors. Thereafter, one can check or modify the
statistics of the risk factors in the “Return Statistics” tab or start a new portfolio optimization with
the “Portfolio Optimization” button in the Main Ribbon.

66
OptiFolio - User's Guide

Fig.87: Example of (MVO) portfolio optimization with historical mean and variance

Fig.88: Example of (MVO) portfolio optimization with expected returns based on risk factors

67
OptiFolio - User's Guide

VIII. User Views


The “User Views” button located in the Main Ribbon allows the user to set the expected returns
using Bayesian statistics. The main input for the calculations is the perspective of the future return
from an asset, which is later adjusted given its historical behavior.

Fig.89: Define views window

The “Define Views” tab allows to administrate groups of perspectives about the assets included in
the portfolio. To create a new group, click on the “New set of views” button, and to create a new
perspective inside this group, use the “New view” button.
OptiFolio works with two types of perspectives: absolutes and relatives. Two start designing a new
perspective, select one of the views in the list that is located at the left of the window.

68
OptiFolio - User's Guide

Fig.90: Example of an absolute perspective

The absolute perspectives only involve one of the assets included in the portfolio. As an example, if
one anticipates that the future return in one year of an asset will be 4%, then in the column
“Weights” one must identify the row that corresponds to this asset and enter the number 1. Instead,
the (annualized) expected return always goes in the last row of the weights column. OptiFolio
interprets each weight (wi) as the coefficient that multiplies each expected return (rie) of the (N)
assets in the portfolio from the next equation:

69
OptiFolio - User's Guide

Fig.91: Example of a relative perspective

The relative perspectives, unlike the absolutes, involves at least two assets included in the portfolio.
As an example, a relative perspective could be that the excess return from two assets in the same
investment group will be 1% in the next year. Thus, the correct way to implement this perspective
would be that the coefficient from the asset that will have more return be equal to 1, and for the
other asset, -1. Again, the (annualized) expected return has to be completed in the last row of the
weights column, which in this case would be equal to the excess return.

70
OptiFolio - User's Guide

Fig.92: Expected returns from the Black-Litterman model

Once all the perspectives have been defined, the expected asset returns can be found in the “Black-
Litterman expected returns” tab. To calculate these returns, the model requires to know the market
portfolio and risk aversion (coefficient), which can be set on the lists that can be found at the
bottom of the window, as well as select the group of perspectives to be used. The first three
columns report the returns based only on the Black equilibrium model; the first one always
maintains the return configuration established in “Data Manager”, while the other two presents the
returns with simple and compound annualization. The fourth column, instead, shows the Black-
Litterman adjustment that has to be implemented on the first three returns presented. Lastly, the
remaining columns provide the adjusted expected returns.
To replace the expected return values with the ones calculated under the Black-Litterman model,
use the “Use results as expected asset returns” button.

71
OptiFolio - User's Guide

Fig.93: Example of (MVO) portfolio optimization with historical mean and variance

Fig.94: Example of (MVO) portfolio optimization with Black-Litterman expected returns

72

You might also like