risk.port2: 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 maximization of the ratio between composed position return and risk. Weights are restricted to be non-negative and with unit sum.

Usage

1
risk.port2(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.port2(s, 0.05)

Example output

, , 1

                5%
StD   1.980978e-08
VaR   4.227507e-09
EL    2.500000e-01
ELD   7.552127e-09
ES    9.552134e-09
SDR   1.408590e-08
EVaR  4.040005e-05
DEVaR 7.543093e-09
ENT   4.737150e-01
DENT  2.390095e-09
ML    2.337144e-09

, , 2

                5%
StD   8.169735e-07
VaR   2.079024e-10
EL    2.500000e-01
ELD   8.375729e-08
ES    1.494550e-08
SDR   6.408921e-07
EVaR  1.435860e-05
DEVaR 3.115398e-08
ENT   4.226168e-01
DENT  5.950552e-08
ML    5.084437e-01

, , 3

                5%
StD   9.354616e-08
VaR   2.411067e-01
EL    2.500000e-01
ELD   2.995817e-07
ES    2.075053e-08
SDR   4.559864e-09
EVaR  4.449666e-02
DEVaR 2.204115e-07
ENT   3.748532e-02
DENT  2.806584e-09
ML    1.789882e-01

, , 4

              5%
StD   0.99999907
VaR   0.75889329
EL    0.25000000
ELD   0.99999961
ES    0.99999995
SDR   0.99999934
EVaR  0.95544859
DEVaR 0.99999974
ENT   0.06618287
DENT  0.99999994
ML    0.31256805

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