Learn R Programming

fAssets (version 3003.81-1)

assets-mcr: Marginal Contributions to Covariance Risk

Description

Computes marginal contributions to covariance risk and related measures for a portfolio of assets.

The functions are:

ll{ covarRisk Computes covariance risk, mcr computes marginal contribution to covariance risk, mcrBeta computes beta, the rescaled mcr to covariance risk, riskConstributions computes covariance risk contributions, riskBudgets computes covariance risk budgets. }

Usage

covarRisk(data, weights = NULL, FUN = "cov", ...)
mcr(data, weights = NULL, FUN = "cov", ...) 
mcrBeta(data, weights = NULL, FUN = "cov", ...) 
riskContributions(data, weights = NULL, FUN = "cov", ...) 
riskBudgets(data, weights = NULL, FUN = "cov", ...)

Arguments

data
a multivariate 'timeSeries' object.
weights
usually a numeric vector which has the length of the number of assets. The vector measures the weights of the individual assets. By default NULL, then an equally weighted set of assets is assumed.
FUN
the name of the covariance estimator function which returns the covariance matrix. By default, the sample covariance estimator.
...
optional arguments to be passet to the function FUN.

Value

  • covarRisk returns the covariance risk (standard deviation), a numeric value. mcr returns the marginal contributions to covariance risk for a portfolio of assets, a numeric value of the same length as the number of assets. mcrBeta returns the marginal contributions to beta for a portfolio of assets, a numeric value of the same length as the number of assets. riskContributions returns the risk contributions to covariance risk for a portfolio of assets, a numeric value of the same length as the number of assets. riskBudgets returns the risk budgets to covariance risk for a portfolio of assets, a numeric value of the same length as the number of assets.

References

Goldberg L., Hayes M.Y., Menchero J., Mitra. I, (2009); Extreme Risk Management, Working Paper, MSCI Barra. Scherer B., (2004); Portfolio Construction and Risk Budgeting, Risk Books, Haymarket House.

Examples

Run this code
## assetsSim -
   # Simulate Data: 
   # Sigma = sqrt(W' COV W)
   set.seed(4711)
   DATA <- assetsSim(100, 6)
   head(DATA)

## covarRisk -
   # Covariance Risk:
   covarRisk(DATA)
   
## mcr -
   # Marginal contribution to Covariance Risk
   # MCR <- d Sigma / d W_i
   mcr(DATA)
    
## mcrBeta -
   # Marginal Beta
   # beta <- MCR / Sigma
   mcrBeta(DATA)

## riskContributions - 
   # Marginal Risk Contributions
   # RC <- Sum_i ( W_i MCR )
   riskContributions(DATA)
   sum(riskContributions(DATA)) - covarRisk(DATA)
   
## riskBudgets -  
   # Marginal Risk Budgets
   # RB <- RC / Sigma
   riskBudgets(DATA)
   sum(riskBudgets(DATA))

Run the code above in your browser using DataLab