risk.port: Computes optimal weights of portfolio based on risk measures

Description Usage Arguments Value Examples

Description

Computes optimal weights of portfolio strategy based on risk measures (StD, VaR, EL, ELD, ES, SDR, EVaR, DEVaR, ENT, DENT, ML) by minimization of the composed position risk. Weights are restricted to be non-negative and with unit sum.

Usage

1
risk.port(x, alpha = c(0.05), beta = 1, p = 2)

Arguments

x

a matrix of observations with each column representing an asset.

alpha

a vector of probabilities for significance level.

beta

a positive risk aversion parameter.

p

a positive value for the power of deviation terms.

Value

An array with optimal weight for each risk measure at all probabilities of interest for every asset in the portfolio.

Examples

1
2
3
4
5
## Computes optimal weights of a portfolio strategy composed by AAPL, BAC, DOW and SUNE.

data(returns)
s <- returns[1:100, 3:6]
risk.port(s, 0.05)

Example output

, , 1

              5%
StD   0.05449016
VaR   0.71544628
EL    0.33687634
ELD   0.04539026
ES    0.02492901
SDR   0.31820371
EVaR  0.03773339
DEVaR 0.10957235
ENT   0.02406684
DENT  0.04539026
ML    0.35087578

, , 2

                5%
StD   1.071156e-02
VaR   8.306129e-06
EL    2.402094e-01
ELD   6.916551e-01
ES    4.222923e-01
SDR   4.718966e-01
EVaR  2.868794e-07
DEVaR 4.816485e-03
ENT   1.806441e-02
DENT  6.916551e-01
ML    4.190558e-02

, , 3

              5%
StD   0.92535060
VaR   0.28188930
EL    0.05230530
ELD   0.15969690
ES    0.54921502
SDR   0.20597962
EVaR  0.40223823
DEVaR 0.76651350
ENT   0.03794142
DENT  0.15969690
ML    0.56828452

, , 4

               5%
StD   0.009447694
VaR   0.002656115
EL    0.370608939
ELD   0.103257715
ES    0.003563699
SDR   0.003920099
EVaR  0.560028097
DEVaR 0.119097668
ENT   0.919927332
DENT  0.103257715
ML    0.038934118

riskR documentation built on May 2, 2019, 1:43 p.m.