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
.
chart.RiskBudget(object, ...)# S3 method for 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 optimize.portfolio.rebalancing
chart.RiskBudget(object, ...,
match.col = "ES", risk.type = "absolute", regime = NULL,
main = "Risk Contribution")
# S3 method for 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)
optimal portfolio object created by optimize.portfolio
or optimize.portfolio.rebalancing
any other passthru parameters to plot
risk contribution or pct_contrib of neighbor portfolios to be plotted, see Details.
"absolute" or "percentage" to plot risk contribution in absolute terms or percentage contribution.
main title for the chart.
label for the y-axis.
label for the x-axis.
the magnification to be used for axis annotation relative to the current setting of cex
.
the magnification to be used for axis annotation relative to the current setting of cex
.
provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc.
numeric in {0,1,2,3}; the style of axis labels
always parallel to the axis [default],
always horizontal,
always perpendicular to the axis,
always vertical.
set the y-axis limit, same as in plot
string of risk column to match. The opt.list
object
may contain risk budgets for ES or StdDev and this will match the proper
column names of the objectives list outp (e.g. ES.contribution).
integer of the regime number. For use with
optimize.portfolio.rebalancing
run with regime switching portfolios.
"line" or "barplot".
color palette or vector of colors to use
legend.loc NULL, "topright", "right", or "bottomright". If legend.loc is NULL, the legend will not be plotted
The magnification to be used for the legend relative to the current setting of cex
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.
optimize.portfolio
optimize.portfolio.rebalancing
chart.StackedBar