There are two ways to look at a portfolio optimization problem that depends on what you are trying to do. One goal is to estimate efficient portfolios and the other is to estimate efficient frontiers. This section focuses on the former goal and Estimate Efficient Frontiers for PortfolioCVaR Object focuses on the latter goal. For information on the workflow when using PortfolioCVaR objects, see PortfolioCVaR Object Workflow.
The most basic way to obtain optimal portfolios is to obtain points over the
entire range of the efficient frontier. Given a portfolio optimization problem in a
PortfolioCVaR
object, the estimateFrontier
function computes
efficient portfolios spaced evenly according to the return proxy from the minimum to
maximum return efficient portfolios. The number of portfolios estimated is
controlled by the hidden property defaultNumPorts
which is set to
10
. A different value for the number of portfolios estimated
is specified as input to estimateFrontier
. This example
shows the default number of efficient portfolios over the entire range of the
efficient frontier:
m = [ 0.05; 0.1; 0.12; 0.18 ]; C = [ 0.0064 0.00408 0.00192 0; 0.00408 0.0289 0.0204 0.0119; 0.00192 0.0204 0.0576 0.0336; 0 0.0119 0.0336 0.1225 ]; m = m/12; C = C/12; AssetScenarios = mvnrnd(m, C, 20000); p = PortfolioCVaR; p = setScenarios(p, AssetScenarios); p = setDefaultConstraints(p); p = setProbabilityLevel(p, 0.95); pwgt = estimateFrontier(p); disp(pwgt)
Columns 1 through 8 0.8670 0.7046 0.5421 0.3825 0.2236 0.0570 0.0000 0.0000 0.0413 0.1193 0.1963 0.2667 0.3392 0.4159 0.3392 0.1753 0.0488 0.0640 0.0811 0.1012 0.1169 0.1427 0.1568 0.1754 0.0429 0.1120 0.1806 0.2496 0.3203 0.3844 0.5040 0.6493 Columns 9 through 10 0.0000 0.0000 0.0230 0.0000 0.1777 0.0000 0.7993 1.0000
pwgt = estimateFrontier(p, 4); disp(pwgt)
0.8670 0.3825 0.0000 0.0000 0.0413 0.2667 0.3392 0.0000 0.0488 0.1012 0.1568 0.0000 0.0429 0.2496 0.5040 1.0000
Starting from the initial portfolio, estimateFrontier
also returns
purchases and sales to get from your initial portfolio to each efficient portfolio
on the efficient frontier. For example, given an initial portfolio in
pwgt0
, you can obtain purchases and
sales:
pwgt0 = [ 0.3; 0.3; 0.2; 0.1 ]; p = setInitPort(p, pwgt0); [pwgt, pbuy, psell] = estimateFrontier(p); display(pwgt) display(pbuy) display(psell)
pwgt = Columns 1 through 8 0.8670 0.7046 0.5421 0.3825 0.2236 0.0570 0.0000 0.0000 0.0413 0.1193 0.1963 0.2667 0.3392 0.4159 0.3392 0.1753 0.0488 0.0640 0.0811 0.1012 0.1169 0.1427 0.1568 0.1754 0.0429 0.1120 0.1806 0.2496 0.3203 0.3844 0.5040 0.6493 Columns 9 through 10 0.0000 0.0000 0.0230 0.0000 0.1777 0.0000 0.7993 1.0000 pbuy = Columns 1 through 8 0.5670 0.4046 0.2421 0.0825 0 0 0 0 0 0 0 0 0.0392 0.1159 0.0392 0 0 0 0 0 0 0 0 0 0 0.0120 0.0806 0.1496 0.2203 0.2844 0.4040 0.5493 Columns 9 through 10 0 0 0 0 0 0 0.6993 0.9000 psell = Columns 1 through 8 0 0 0 0 0.0764 0.2430 0.3000 0.3000 0.2587 0.1807 0.1037 0.0333 0 0 0 0.1247 0.1512 0.1360 0.1189 0.0988 0.0831 0.0573 0.0432 0.0246 0.0571 0 0 0 0 0 0 0 Columns 9 through 10 0.3000 0.3000 0.2770 0.3000 0.0223 0.2000 0 0
0
. estimateFrontier
| estimateFrontierByReturn
| estimateFrontierByRisk
| estimateFrontierByRisk
| estimateFrontierLimits
| estimatePortReturn
| estimatePortRisk
| PortfolioCVaR
| setSolver