chart.RiskBudget {PortfolioAnalytics} | R Documentation |
Generic method to chart risk contribution
Description
This function is the generic method to chart risk budget objectives for
optimize.portfolio
, optimize.portfolio.rebalancing
, and
opt.list
objects. This function charts the contribution or percent
contribution of the resulting objective measures of a
risk_budget_objective
. The risk contributions for optimize.portfolio.rebalancing
objects are plotted through time with chart.StackedBar
.
Usage
chart.RiskBudget(object, ...)
## S3 method for class 'optimize.portfolio'
chart.RiskBudget(
object,
...,
neighbors = NULL,
risk.type = "absolute",
main = "Risk Contribution",
ylab = "",
xlab = NULL,
cex.axis = 0.8,
cex.lab = 0.8,
element.color = "darkgray",
las = 3,
ylim = NULL
)
## S3 method for class 'optimize.portfolio.rebalancing'
chart.RiskBudget(
object,
...,
match.col = "ES",
risk.type = "absolute",
regime = NULL,
main = "Risk Contribution"
)
## S3 method for class 'opt.list'
chart.RiskBudget(
object,
...,
match.col = "ES",
risk.type = "absolute",
main = "Risk Budget",
plot.type = "line",
cex.axis = 0.8,
cex.lab = 0.8,
element.color = "darkgray",
las = 3,
ylim = NULL,
colorset = NULL,
legend.loc = NULL,
cex.legend = 0.8
)
Arguments
object |
optimal portfolio object created by |
... |
any other passthru parameters to |
neighbors |
risk contribution or pct_contrib of neighbor portfolios to be plotted, see Details. |
risk.type |
"absolute" or "percentage" to plot risk contribution in absolute terms or percentage contribution. |
main |
main title for the chart. |
ylab |
label for the y-axis. |
xlab |
label for the x-axis. |
cex.axis |
the magnification to be used for axis annotation relative to the current setting of |
cex.lab |
the magnification to be used for axis annotation relative to the current setting of |
element.color |
provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc. |
las |
numeric in {0,1,2,3}; the style of axis labels
|
ylim |
set the y-axis limit, same as in |
match.col |
string of risk column to match. The |
regime |
integer of the regime number. For use with
|
plot.type |
"line" or "barplot". |
colorset |
color palette or vector of colors to use |
legend.loc |
legend.loc NULL, "topright", "right", or "bottomright". If legend.loc is NULL, the legend will not be plotted |
cex.legend |
The magnification to be used for the legend relative to the current setting of |
Details
neighbors
may be specified in three ways.
The first is as a single number of neighbors. This will extract the
neighbors
closest to the portfolios in terms of the out
numerical statistic.
The second method consists of a numeric vector for neighbors
.
This will extract the neighbors
with portfolio index numbers that
correspond to the vector contents.
The third method for specifying neighbors
is to pass in a matrix.
This matrix should look like the output of extractStats
, and
should contain properly named contribution and pct_contrib columns.
See Also
optimize.portfolio
optimize.portfolio.rebalancing
chart.StackedBar