An alternative risk measure to the covariance is the Conditional Value at Risk, CVaR, which is also known as mean excess loss, mean shortfall or tail Value at Risk, VaR. For a given time horizon and confidence level, CVaR is the conditional expectation of the loss above VaR for the time horizon and the confidence level under consideration.

Pflug (2000) was the first to show that CVaR is a coherent risk measure and Rockafellar & Uryasev (2000) has shown that CVaR has other attractive properties including convexity.

Portfolio Specification

As in the case of the mean-variance portfolio, the portfolio specification manages all the settings which characterize the mean-CVaR portfolio. It is important to note that in contrast to the mean-variance portfolio specification, the type of the portfolio always has to be specified in the case of CVaR portfolios. The significance level of alpha is 0.05 by default, but can be modified by the user.

## 
## Model List:  
##  Type:                      CVaR
##  Optimize:                  minRisk
##  Estimator:                 covEstimator
##  Params:                    alpha = 0.05 a = 1
## 
## Portfolio List:  
##  Target Weights:            NULL
##  Target Return:             NULL
##  Target Risk:               NULL
##  Risk-Free Rate:            0
##  Number of Frontier Points: 50
##  Status:                    NA
## 
## Optim List:  
##  Solver:                    solveRglpk
##  Objective:                 portfolioObjective portfolioReturn portfolioRisk
##  Trace:                     FALSE
## 
## Model List:  
##  Type:                      CVaR
##  Optimize:                  minRisk
##  Estimator:                 covEstimator
##  Params:                    alpha = 0.05 a = 1
## 
## Portfolio List:  
##  Target Weights:            NULL
##  Target Return:             NULL
##  Target Risk:               NULL
##  Risk-Free Rate:            0
##  Number of Frontier Points: 50
##  Status:                    NA
## 
## Optim List:  
##  Solver:                    solveRglpk
##  Objective:                 portfolioObjective portfolioReturn portfolioRisk
##  Trace:                     FALSE

We will work with long-only mean-CVaR portfolios. Specifying that our contraint will be long only, will force the lower and upper bounds for the weights to zero and one, respectively.

Mean-CVaR Portfolios

The following examples show how to compute feasible mean-CVaR portfolios and efficient CVaR portfolios. These include not only the general cases, i.e. computing the portfolio with the lowest risk for a given return, or the portfolio with the highest return for a given risk, but also the special cases of the global minimum-risk portfolio and the portfolio with the highest return/risk ratio.

## 
## Title:
##  CVAR Feasible Portfolio 
##  Estimator:         covEstimator 
##  Solver:            solveRglpk.CVAR 
##  Optimize:          minRisk 
##  Constraints:       LongOnly 
## 
## Portfolio Weights:
##  DGKC ENGRO  FCCL  FFBL   FFC   HBL  HCAR  HUBC  JSCL KAPCO   KEL  LUCK 
## 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 
##  MARI   MCB  MLCF   NBP   NML  OGDC  PAEL  PIOC   POL   PPL   PSO   PTC 
## 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 
## SEARL   TRG   UBL 
## 0.037 0.037 0.037 
## 
## Covariance Risk Budgets:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0446 0.0406 0.0477 0.0283 0.0241 0.0288 0.0351 0.0219 0.0596 0.0175 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0476 0.0367 0.0345 0.0355 0.0570 0.0369 0.0425 0.0283 0.0385 0.0427 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0317 0.0288 0.0341 0.0350 0.0223 0.0676 0.0322 
## 
## Target Returns and Risks:
##   mean    Cov   CVaR    VaR 
## 0.0319 1.3460 3.5094 2.1823 
## 
## Description:
##  Mon Jan 16 15:19:21 2017 by user: azam.yahya

Displayed are the following for the results to plot the weights, the performance attribution, and the risk attribution expressed by the covariance risk budgets.

Weights plots for an equal-weights CVaR portfolio are shown above. Although we invest the same amount in each asset, the major contribution comes from the Swiss and foreign equities and alternative instruments. The same holds for the covariance risk budgets and the weighted returns.

Now let us observe how the results change if we change the CVaR confidence level from a = 0.05 to a = 0.10

## 
## Title:
##  CVAR Feasible Portfolio 
##  Estimator:         covEstimator 
##  Solver:            solveRglpk.CVAR 
##  Optimize:          minRisk 
##  Constraints:       LongOnly 
## 
## Portfolio Weights:
##  DGKC ENGRO  FCCL  FFBL   FFC   HBL  HCAR  HUBC  JSCL KAPCO   KEL  LUCK 
## 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 
##  MARI   MCB  MLCF   NBP   NML  OGDC  PAEL  PIOC   POL   PPL   PSO   PTC 
## 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 0.037 
## SEARL   TRG   UBL 
## 0.037 0.037 0.037 
## 
## Covariance Risk Budgets:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0446 0.0406 0.0477 0.0283 0.0241 0.0288 0.0351 0.0219 0.0596 0.0175 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0476 0.0367 0.0345 0.0355 0.0570 0.0369 0.0425 0.0283 0.0385 0.0427 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0317 0.0288 0.0341 0.0350 0.0223 0.0676 0.0322 
## 
## Target Returns and Risks:
##   mean    Cov   CVaR    VaR 
## 0.0319 1.3460 2.5982 1.2803 
## 
## Description:
##  Mon Jan 16 15:19:22 2017 by user: azam.yahya

Mean-CVaR Portfolio with the Lowest Risk for a Given Return

Specifying the target return, we can compute an optimized efficient portfolio which has the lowest risk for a given return. In this example, we start from the equal weights portfolio, and search for a portfolio with the same returns, but a lower covariance risk.

## 
## Title:
##  CVaR Efficient Portfolio 
##  Estimator:         covEstimator 
##  Solver:            solveRglpk.CVAR 
##  Optimize:          minRisk 
##  Constraints:       LongOnly 
##  VaR Alpha:         0.05 
## 
## Portfolio Weights:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0000 0.0000 0.0000 0.1123 0.0806 0.0558 0.0301 0.1588 0.0000 0.3099 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0000 0.0000 0.0083 0.0000 0.0000 0.0000 0.0000 0.0440 0.0000 0.0393 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0132 0.0561 0.0000 0.0000 0.0677 0.0000 0.0238 
## 
## Covariance Risk Budgets:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0000 0.0000 0.0000 0.1234 0.0781 0.0521 0.0305 0.1679 0.0000 0.3024 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0000 0.0000 0.0075 0.0000 0.0000 0.0000 0.0000 0.0407 0.0000 0.0469 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0127 0.0549 0.0000 0.0000 0.0596 0.0000 0.0233 
## 
## Target Returns and Risks:
##   mean    Cov   CVaR    VaR 
## 0.0385 1.0526 2.6795 1.5807 
## 
## Description:
##  Mon Jan 16 15:19:23 2017 by user: azam.yahya

The covariance risk of the optimized portfolio has been lowered from 1.35 to 1.0551 for the same target return.

The plots are shown below for minimum risk CVaR portfolio.

Weights plots for a minimum risk CVaR portfolio are shown above: Optimizing the risk for the target return of the equal weights portfolio leads to badly diversified portfolio, dominated by the risky alternative instruments.

Global Minimum Mean-CVaR Portfolio

The global minimum risk portfolio is the efficient portfolio with the lowest possible risk.

## 
## Title:
##  CVaR Minimum Risk Portfolio 
##  Estimator:         covEstimator 
##  Solver:            solveRglpk.CVAR 
##  Optimize:          minRisk 
##  Constraints:       LongOnly 
##  VaR Alpha:         0.05 
## 
## Portfolio Weights:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0000 0.0000 0.0000 0.1123 0.0806 0.0558 0.0301 0.1588 0.0000 0.3099 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0000 0.0000 0.0083 0.0000 0.0000 0.0000 0.0000 0.0440 0.0000 0.0393 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0132 0.0561 0.0000 0.0000 0.0677 0.0000 0.0238 
## 
## Covariance Risk Budgets:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0000 0.0000 0.0000 0.1234 0.0781 0.0521 0.0305 0.1679 0.0000 0.3024 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0000 0.0000 0.0075 0.0000 0.0000 0.0000 0.0000 0.0407 0.0000 0.0469 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0127 0.0549 0.0000 0.0000 0.0596 0.0000 0.0233 
## 
## Target Returns and Risks:
##   mean    Cov   CVaR    VaR 
## 0.0385 1.0526 2.6795 1.5807 
## 
## Description:
##  Mon Jan 16 15:19:24 2017 by user: azam.yahya

The portfolio is now dominated by the FFBL, HUBC and KAPCO, which contribute 58% to the weights of the optimized portfolio.

Internally, the global minimum mean-CVaR portfolio is calculated by minimizing the efficient portfolio with respect to the target risk.

The plots for global minimum risk portfolio are shown below that shows tat FFBL, HUBC and KAPCO dominates the global minimum risk portfolio

Max Return/Risk Ratio Mean-CVaR Portfolio

The Max Return/Risk portfolio is calculated by minimization of the ‘Sortino Ratio’ for a given risk-free rate. The Sortino ratio is the ratio of the target return lowered by the risk-free rate and the CvaR risk. The risk-free rate in the default specification is zero

## 
## Title:
##  CVaR Max Return/Risk Ratio Portfolio 
##  Estimator:         covEstimator 
##  Solver:            solveRglpk.CVAR 
##  Optimize:          minRisk 
##  Constraints:       LongOnly 
##  VaR Alpha:         0.05 
## 
## Portfolio Weights:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2638 0.3176 0.0000 0.0000 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0000 0.3732 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0000 0.0000 0.0000 0.0000 0.0454 0.0000 0.0000 
## 
## Covariance Risk Budgets:
##   DGKC  ENGRO   FCCL   FFBL    FFC    HBL   HCAR   HUBC   JSCL  KAPCO 
## 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.3568 0.2232 0.0000 0.0000 
##    KEL   LUCK   MARI    MCB   MLCF    NBP    NML   OGDC   PAEL   PIOC 
## 0.0000 0.3968 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 
##    POL    PPL    PSO    PTC  SEARL    TRG    UBL 
## 0.0000 0.0000 0.0000 0.0000 0.0232 0.0000 0.0000 
## 
## Target Returns and Risks:
##   mean    Cov   CVaR    VaR 
## 0.0913 1.4456 3.4470 2.0933 
## 
## Description:
##  Mon Jan 16 15:19:47 2017 by user: azam.yahya

The portfolio is now dominated by the HCAR, HUBC and LUCK, which contribute 95% to the weights of the optimized portfolio. To show the plot of the domination by three equity Maximum risk/return portfolio, it is shown below