plot.ghyp.attrib | R Documentation |
These functions plot the contribution of each asset to the overall portfolio expected shortfall.
## S3 method for class 'ghyp.attrib'
plot(
x,
metrics = c("contribution", "sensitivity"),
column.index = NULL,
percentage = FALSE,
colorset = NULL,
horiz = FALSE,
unstacked = TRUE,
pie.chart = FALSE,
sub = NULL,
...
)
x |
A |
metrics |
either the |
column.index |
which column of the object. |
percentage |
plot contribution or sensitivity in percent. |
colorset |
vector of colors for the chart. |
horiz |
plot horizontally. |
unstacked |
unstacked plot. |
pie.chart |
should a pie chart be plotted. |
sub |
subtitle. |
... |
arguments passed to |
Marc Weibel
ESghyp.attribution
.
## Not run:
data(smi.stocks)
## Fit a NIG model to Novartis, CS and Nestle log-returns
assets.fit <- fit.NIGmv(smi.stocks[, c("Novartis", "CS", "Nestle")], silent = TRUE)
## Define Weights of the Portfolio
weights <- c(0.2, 0.5, 0.3)
## Confidence level for Expected Shortfall
es.levels <- c(0.01)
portfolio.attrib <- ESghyp.attribution(alpha=es.levels, object=assets.fit, weights=weights)
## Plot Risk Contribution for each Asset
plot(portfolio.attrib, metrics='contribution')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.