plot-ghyp.attribution: Plot ES contribution

plot.ghyp.attribR Documentation

Plot ES contribution

Description

These functions plot the contribution of each asset to the overall portfolio expected shortfall.

Usage

## 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,
  ...
)

Arguments

x

A ghyp.attribution object.

metrics

either the contribution or sensitivity will be plotted.

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 plot function.

Author(s)

Marc Weibel

See Also

ESghyp.attribution.

Examples

## 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)

ghyp documentation built on Sept. 12, 2024, 7:38 a.m.