Title: | Optimal Capital Allocations |
---|---|
Description: | Computes optimal capital allocations based on some standard principles such as Haircut, Overbeck type II and the Covariance Allocation Principle. It also provides some shortcuts for obtaining the Value at Risk and the Expectation Shortfall, using both the normal and the t-student distribution, see Urbina and Guillén (2014)<doi:10.1016/j.eswa.2014.05.017> and Urbina (2013)<http://hdl.handle.net/2099.1/19443>. |
Authors: | Jilber Urbina |
Maintainer: | Jilber Urbina <[email protected]> |
License: | GPL-2 |
Version: | 0.5 |
Built: | 2024-12-08 06:49:10 UTC |
Source: | CRAN |
This function implements the covariance allocation principle for optimal capital allocation.
cap(Loss, Capital)
cap(Loss, Capital)
Loss |
A matrix containing the individual losses in each column |
Capital |
A scalar representing the capital to be allocated to each loss. |
The Covariance Allocation Principle correspond to the following expression:
\[K_{i} = \dfrac{K}{Var[S]} Cov(X_{i}, S), \quad i=1, \ldots, n,\]where \(K_i\) is the capital to be allocated to the ith loss, \(K\) is the total capital to be allocated, \(X_i\) is the individual unit loss and S is the total (aggretate) loss, this comes from \(\sum_{i}X_{i}\). \(Cov(X_{i}, S)\) is the covariance between the individual loss \(X_i\) and the aggregate loss S; and \(Var(S)\) is the variance of the aggregate loss.
A vector containing each asset and the corresponding capital allocation. If Capital=1
, then the returned value will be the proportions of capital required by each loss to be faced.
Jilber Urbina
Dhaene J., Tsanakas A., Valdez E. and Vanduffel S. (2011). Optimal Capital Allocation Principles. The Journal of Risk and Insurance. Vol. 00, No. 0, 1-28.
Urbina, J. (2013) Quantifying Optimal Capital Allocation Principles based on Risk Measures. Master Thesis, Universitat Politècnica de Catalunya.
Urbina, J. and Guillén, M. (2014). An application of capital allocation principles to operational risk and the cost of fraud. Expert Systems with Applications. 41(16):7023-7031.
data(dat1, dat2) Loss <- cbind(Loss1=dat1[1:400, ], Loss2=unname(dat2)) # Proportions of capital to be allocated to each bussines unit cap(Loss, Capital=1) # Capital allocation, # capital is determined as the empirical VaR of the losses at 99\% K <- quantile(rowSums(Loss), probs = 0.99) cap(Loss, Capital=K)
data(dat1, dat2) Loss <- cbind(Loss1=dat1[1:400, ], Loss2=unname(dat2)) # Proportions of capital to be allocated to each bussines unit cap(Loss, Capital=1) # Capital allocation, # capital is determined as the empirical VaR of the losses at 99\% K <- quantile(rowSums(Loss), probs = 0.99) cap(Loss, Capital=K)
Dataset named Public data risk no. 1 consisting in 1000 of simulated data.
data(dat1)
data(dat1)
A data frame with 1000 observations on the following variable.
y
a numeric vector
Bolance, C.; Guillen, M.; Gustafsson, J. & Nielsen, J. P. Quantitative Operational Risk Models Chapman & Hall/CRC, 2012
data(dat1)
data(dat1)
Dataset named Public data risk no. 1 consisting in 400 of simulated data.
data(dat2)
data(dat2)
A data frame with 400 observations on the following variable.
y
a numeric vector
Bolance, C.; Guillen, M.; Gustafsson, J. & Nielsen, J. P. Quantitative Operational Risk Models Chapman & Hall/CRC, 2012
data(dat2)
data(dat2)
Computes the Expected Shortfall of a given amount of loss based on variance-covariance method.
ES( variance, alpha = 0.95, weights = NULL, model = c("normal", "t-student", "both"), df = NULL, percentage = FALSE )
ES( variance, alpha = 0.95, weights = NULL, model = c("normal", "t-student", "both"), df = NULL, percentage = FALSE )
variance |
It could be either a scalar or a matrix containing the variances and covariances of the losses. Provide a covariance matrix when analyzing correlated losses or a scalar when dealing with a single loss. |
alpha |
A numeric value (either a single one or a vector) consisting of the significance level at which ES has to be computed, it can either be a single numeric value or a vector of numeric values. |
weights |
A vector of weights of size N for weighting the variance of losses.
When |
model |
A character string indicating which distribution is to be used for computing the ES,
the default value is the |
df |
An integer indicating the degrees of freedom for the t-student distribution when setting
|
percentage |
Logical indicating whether the file names in the VaR table should be presented in percentage or decimal. |
ES
computes the Expected Shortfall (ES) of a certaing amount of loss based upon the following general formulation:
where \(\alpha\) is the significance level, \(VaR_u(X)\) is the Value-at-Risk of \(X.\)
ES
for the normal case is based on the following expression:
Meanwhile, ES
for the t-student distribution takes comes from:
Jilber Urbina
Dhaene J., Tsanakas A., Valdez E. and Vanduffel S. (2011). Optimal Capital Allocation Principles. The Journal of Risk and Insurance. Vol. 00, No. 0, 1-28.
McNeil, A. J.; Frey, R. & Embrechts, P. Quantitative risk management: concepts, techniques and tools. Princeton University Press, 2005.
Urbina, J. (2013) Quantifying Optimal Capital Allocation Principles based on Risk Measures. Master Thesis, Universitat Politècnica de Catalunya.
Urbina, J. and Guillén, M. (2014). An application of capital allocation principles to operational risk and the cost of fraud. Expert Systems with Applications. 41(16):7023-7031.
# Exercise 2.21, page 46 in McNeil et al (2005) alpha <- c(.90, .95, .975, .99, .995) (ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='normal'))*10000 (ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='t-student', df=4))*10000 # Both type of models at once. (ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='both', df=4))*10000 # A vector of losses variance <- matrix(c(100,150,150,900), 2) # covariance matrix w <- c(0.5, 0.5) # a vector weights ES(variance=variance, weights=w, alpha=0.95)
# Exercise 2.21, page 46 in McNeil et al (2005) alpha <- c(.90, .95, .975, .99, .995) (ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='normal'))*10000 (ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='t-student', df=4))*10000 # Both type of models at once. (ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='both', df=4))*10000 # A vector of losses variance <- matrix(c(100,150,150,900), 2) # covariance matrix w <- c(0.5, 0.5) # a vector weights ES(variance=variance, weights=w, alpha=0.95)
Capital allocation based on the Haircut Allocation Principle.
hap(Loss, Capital, alpha = 0.95, model = "normal", df = NULL)
hap(Loss, Capital, alpha = 0.95, model = "normal", df = NULL)
Loss |
Either a scalar or a vector of size N containing the mean losses. |
Capital |
A scalar representing the capital to be allocated to each loss. |
alpha |
A numeric value (either a single one or a vector) consisting of the significance level at which ES has to be computed, it can either be a single numeric value or a vector of numeric values. |
model |
A character string indicating which distribution is to be used for computing the
VaR underlying the Haircut Allocation Principle (HAP), the default value is the |
df |
An integer indicating the degrees of freedom for the t-student distribution when setting
|
This function computes the capital allocation based on the so-called Haircut Allocation Principle whose expression is as follows:
\[K_{i} = \frac{K}{\sum_{j=1}^{n} F_{X_{j}}^{-1}(p)} F_{X_{i}}^{-1}(p)\]For \(i=1,\dots,n\), where \(K_i\) represents the optimal capital to be allocated to each individual loss for the i-th business unit, K is the total capital to be allocated, \(F_{X_{i}}^{-1}(p)\) is the quantile function (VaR) for the i-th loss.
A vector containing the optimal capital allocation, if
Capital
is set to 1, then the returned matrix will consist of the proportions of capital
each individual loss needs to be optimally faced.
Jilber Urbina
Dhaene J., Tsanakas A., Valdez E. and Vanduffel S. (2011). Optimal Capital Allocation Principles. The Journal of Risk and Insurance. Vol. 00, No. 0, 1-28.
McNeil, A. J.; Frey, R. & Embrechts, P. Quantitative risk management: concepts, techniques and tools. Princeton University Press, 2005.
Urbina, J. (2013) Quantifying Optimal Capital Allocation Principles based on Risk Measures. Master Thesis, Universitat Politècnica de Catalunya.
Urbina, J. and Guillén, M. (2014). An application of capital allocation principles to operational risk and the cost of fraud. Expert Systems with Applications. 41(16):7023-7031.
data(dat1, dat2) Loss <- cbind(Loss1=dat1[1:400, ], Loss2=unname(dat2)) # Proportions of capital to be allocated to each bussines unit hap(Loss, Capital=1) # Capital allocation, # capital is determined as the empirical VaR of the losses at 99\% K <- quantile(rowSums(Loss), probs = 0.99) hap(Loss, Capital=K)
data(dat1, dat2) Loss <- cbind(Loss1=dat1[1:400, ], Loss2=unname(dat2)) # Proportions of capital to be allocated to each bussines unit hap(Loss, Capital=1) # Capital allocation, # capital is determined as the empirical VaR of the losses at 99\% K <- quantile(rowSums(Loss), probs = 0.99) hap(Loss, Capital=K)
This function implements the Overbeck type II allocation principle for optimal capital allocation.
Overbeck2( Loss, Capital, alpha = 0.95, model = c("normal", "t-student", "both"), df = NULL )
Overbeck2( Loss, Capital, alpha = 0.95, model = c("normal", "t-student", "both"), df = NULL )
Loss |
Either a scalar or a vector of size N containing the mean losses. |
Capital |
A scalar representing the capital to be allocated to each loss. |
alpha |
A numeric value (either a single one or a vector) consisting of the significance level at which the allocation has to be computed, it can either be a single numeric value or a vector of numeric values. |
model |
A character string indicating which distribution is to be used for computing the
VaR underlying the Overbeck type II principle, the default value is the |
df |
An integer indicating the degrees of freedom for the t-student distribution when setting
|
Overbeck2
computes the capital allocation based on the following formulation:
Where \(K\) is the aggregate capital to be allocated, \(CTE_p[S] \) is the Conditional Tail Expectation of the aggregate loss at level \(p\), \(X_i\) is the individual loss, \(S\) is the aggregate loss and \( F_X^-1(p)\) is the quantile function of \(X\) at level \(p.\)
A vector containing the optimal capital allocation,
if Capital
is set to 1, then the returned matrix will consist of the proportions of capital
each individual loss needs to be optimally faced.
Jilber Urbina
Dhaene J., Tsanakas A., Valdez E. and Vanduffel S. (2011). Optimal Capital Allocation Principles. The Journal of Risk and Insurance. Vol. 00, No. 0, 1-28.
Urbina, J. (2013) Quantifying Optimal Capital Allocation Principles based on Risk Measures. Master Thesis, Universitat Politècnica de Catalunya.
Urbina, J. and Guillén, M. (2014). An application of capital allocation principles to operational risk and the cost of fraud. Expert Systems with Applications. 41(16):7023-7031.
data(dat1, dat2) Loss <- cbind(Loss1=dat1[1:400, ], Loss2=unname(dat2)) # Proportions of capital to be allocated to each bussines unit Overbeck2(Loss, Capital=1) # Capital allocation, # capital is determined as the empirical VaR of the losses at 99\% K <- quantile(rowSums(Loss), probs = 0.99) Overbeck2(Loss, Capital=K)
data(dat1, dat2) Loss <- cbind(Loss1=dat1[1:400, ], Loss2=unname(dat2)) # Proportions of capital to be allocated to each bussines unit Overbeck2(Loss, Capital=1) # Capital allocation, # capital is determined as the empirical VaR of the losses at 99\% K <- quantile(rowSums(Loss), probs = 0.99) Overbeck2(Loss, Capital=K)
Risk measures such as Value at Risk (VaR) and Expected Shortfall (ES) with normal and t-student distributions based on variance-covariance method. It is a shortcut for VaR and ES.
Risk( variance, alpha = 0.95, measure = c("both", "VaR", "ES"), weights = NULL, model = c("both", "normal", "t-student"), df = NULL, percentage = FALSE )
Risk( variance, alpha = 0.95, measure = c("both", "VaR", "ES"), weights = NULL, model = c("both", "normal", "t-student"), df = NULL, percentage = FALSE )
variance |
It could be either a scalar or a matrix containing the variances and covariances of the losses. Provide a covariance matrix when analyzing correlated losses or a scalar when dealing with a single loss. |
alpha |
The confidence level at which either the VaR or the ES will be computed, by default |
measure |
An optional character string giving a measure for computing the risk. |
weights |
A vector containing the weights. It is only needed if |
model |
A character string indicating which probability model has to be used for computing the risk measures, it could only be a
normal distribution or a t-student distribution with \(v\) degrees of freedom. The normal distribution is the
default model for this function. |
df |
An integer ( |
percentage |
Logical indicating whether the file names in the VaR table should be presented in percentage or decimal. |
A data.frame
containing each risk measure at its corresponding confidence level.
Jilber Urbina
Dhaene J., Tsanakas A., Valdez E. and Vanduffel S. (2011). Optimal Capital Allocation Principles. The Journal of Risk and Insurance. Vol. 00, No. 0, 1-28.
Urbina, J. (2013) Quantifying Optimal Capital Allocation Principles based on Risk Measures. Master Thesis, Universitat Politècnica de Catalunya.
Urbina, J. and Guillén, M. (2014). An application of capital allocation principles to operational risk and the cost of fraud. Expert Systems with Applications. 41(16):7023-7031.
# Reproducing Table 2.1 in page 47 of # McNeal A., Frey R. and Embrechts P (2005). alpha <- c(.90, .95, .975, .99, .995) (Risk(variance=(0.2/sqrt(250))^2, alpha=alpha, measure='both', model='both', df=4))*10000 # only VaR results (Risk(variance=(0.2/sqrt(250))^2, alpha=alpha, measure='VaR', model='both', df=4))*10000 # only SE based on a 4 degrees t-student. (Risk(variance=(0.2/sqrt(250))^2, alpha=alpha, measure='ES', model='t-student', df=4))*10000
# Reproducing Table 2.1 in page 47 of # McNeal A., Frey R. and Embrechts P (2005). alpha <- c(.90, .95, .975, .99, .995) (Risk(variance=(0.2/sqrt(250))^2, alpha=alpha, measure='both', model='both', df=4))*10000 # only VaR results (Risk(variance=(0.2/sqrt(250))^2, alpha=alpha, measure='VaR', model='both', df=4))*10000 # only SE based on a 4 degrees t-student. (Risk(variance=(0.2/sqrt(250))^2, alpha=alpha, measure='ES', model='t-student', df=4))*10000
Analytical approach for calculating VaR based on Variance-Covariance Method based on both normal and t-student distribution.
VaR( variance, alpha = 0.95, weights = NULL, model = c("normal", "t-student", "both"), df = NULL, percentage = FALSE )
VaR( variance, alpha = 0.95, weights = NULL, model = c("normal", "t-student", "both"), df = NULL, percentage = FALSE )
variance |
It could be either a scalar or a matrix containing the variances and covariances of the losses. Provide a covariance matrix when analyzing correlated losses or a scalar when dealing with a single loss. |
alpha |
The confidence level at which either the VaR will be computed, by default |
weights |
A vector of weights of size N for weighting the variance of losses. When |
model |
A character string indicating which probability model has to be used for computing the risk
measures, it could be a normal distribution or a t-student distribution with \(v\) degrees of freedom.
The normal distibution is the default model for this funcion. |
df |
An integer (df>2) denoting the degrees of freedom, only required if |
percentage |
Logical indicating whether the file names in the VaR table should be presented in percentage or decimal. |
A data.frame
containing the VaR at its corresponding confidence level.
Jilber Urbina
Dhaene J., Tsanakas A., Valdez E. and Vanduffel S. (2011). Optimal Capital Allocation Principles. The Journal of Risk and Insurance. Vol. 00, No. 0, 1-28.
Urbina, J. (2013) Quantifying Optimal Capital Allocation Principles based on Risk Measures. Master Thesis, Universitat Politècnica de Catalunya.
Urbina, J. and Guillén, M. (2014). An application of capital allocation principles to operational risk and the cost of fraud. Expert Systems with Applications. 41(16):7023-7031.
# Reproducing VaR from Table 2.1 in page 47 of # McNeal A., Frey R. and Embrechts P (2005). alpha <- c(.90, .95, .975, .99, .995) VaR(variance=(10000*0.2/sqrt(250))^2, alpha=alpha, model='both', df=4) # only normal VaR results VaR(variance=(10000*0.2/sqrt(250))^2, alpha=alpha)
# Reproducing VaR from Table 2.1 in page 47 of # McNeal A., Frey R. and Embrechts P (2005). alpha <- c(.90, .95, .975, .99, .995) VaR(variance=(10000*0.2/sqrt(250))^2, alpha=alpha, model='both', df=4) # only normal VaR results VaR(variance=(10000*0.2/sqrt(250))^2, alpha=alpha)