Calculates a given portfolio risk/deviation measure given a set of weights and matrix of returns, possible representing a forecast scenario.
riskfun(weights, Data, risk = c("mad", "ev", "minimax", "cvar", "cdar", "lpm"),
benchmark = NULL, alpha = 0.05, moment = 1, threshold = 0, VaR = NULL, DaR = NULL)
A numeric value representing the risk/deviation measure.
vector of weights.
Matrix of returns.
Choice of measure.
(Optional) vector of benchmark returns with same number of rows as Data.
The lower quantile for the “cvar” and “cdar” measures.
The “lpm” measure moment.
The “lpm” measure threshold. A value of 999 will subtract the portfolio mean.
(Optional) The pre-calculated VaR for the “cvar” measure.
(Optional) The pre-calculated DaR for the “cdar” measure.
Alexios Galanos
A simple utility function for the calculation and understanding of some of the risk and deviation measures implemented in the package.