Generate efficient frontiers plot by providing frontiers.
plotFrontiers(
R,
frontiers,
risk,
ES_alpha = 0.05,
EQS_alpha = 0.05,
moment_setting = NULL,
main = "Efficient Frontiers",
plot_type = "l",
cex.axis = 0.5,
element.color = "darkgray",
legend.loc = NULL,
legend.labels = NULL,
cex.legend = 0.8,
xlim = NULL,
ylim = NULL,
...,
labels.assets = TRUE,
pch.assets = 21,
cex.assets = 0.8,
col = NULL,
lty = NULL,
lwd = NULL
)
an xts object of asset returns
a list of frontiers, for example, list(ef1=meanvar.efficient.frontier(), ef2=meanvar.efficient.frontier())
type of risk that you want to compare, could be 'StdDev', 'ES', 'EQS'
the default value is 0.05, but could be specified as any value between 0 and 1
the default value is 0.05, but could be specified as any value between 0 and 1
the default is NULL, if customize momentFUN please provide moment_setting=list(mu=, sigma=)
title used in the plot.
define the plot_type, default is "l"
the magnification to be used for sizing the axis text relative to the current setting of 'cex', similar to plot
.
provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc.
location of the legend; NULL, "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center".
character vector to use for the legend labels.
The magnification to be used for sizing the legend relative to the current setting of 'cex', similar to plot
.
set the x-axis limit, same as in plot
.
set the y-axis limit, same as in plot
.
passthrough parameters to plot
.
TRUE/FALSE to include the asset names in the plot.
plotting character of the assets, same as in plot
.
A numerical value giving the amount by which the asset points and labels should be magnified relative to the default.
vector of colors with length equal to the number of portfolios in frontiers
.
vector of line types with length equal to the number of portfolios in frontiers
.
vector of line widths with length equal to the number of portfolios in frontiers
.
Xinran Zhao
This function provides the ability to plot frontiers based on the result of `meanvar.efficient.frontier`, `meanetl.efficient.frontier` or `meaneqs.efficient.frontier`.
When using meanvar.efficient.frontier
, meanetl.efficient.frontier
and meaneqs.efficient.frontier
, the result will be frontiers data,
including the weights for each point on the mean-risk efficient frontiers.
Before using this function, user should declare which risk that they want to
compare, and what parameters that they want to use to calculate the risk,
e.g. ES_alpha
for ES, moment_setting
for var. Then this function
will calculate back mean and risk based on the weight, and draw a plot.
Default settings use colors and line types to differentiate portfolios, and set the portfolio name as 'Portfolio 1' and so on. Users could customize col, lty, lwd and legend.labels to better the plot.