chart.EfficientFrontier {PortfolioAnalytics}R Documentation

Chart the efficient frontier and risk-return scatter

Description

Chart the efficient frontier and risk-return scatter of the assets for optimize.portfolio or efficient.frontier objects

Usage

chart.EfficientFrontier(object, ...)

## S3 method for class 'optimize.portfolio.CVXR'
chart.EfficientFrontier(
  object,
  ...,
  optimize_method = "CVXR",
  match.col = "ES",
  n.portfolios = 25,
  xlim = NULL,
  ylim = NULL,
  cex.axis = 0.8,
  element.color = "darkgray",
  main = "Efficient Frontier",
  RAR.text = "SR",
  rf = 0,
  tangent.line = TRUE,
  cex.legend = 0.8,
  chart.assets = TRUE,
  labels.assets = TRUE,
  pch.assets = 21,
  cex.assets = 0.8
)

## S3 method for class 'optimize.portfolio.ROI'
chart.EfficientFrontier(
  object,
  ...,
  optimize_method = "ROI",
  match.col = "ES",
  n.portfolios = 25,
  xlim = NULL,
  ylim = NULL,
  cex.axis = 0.8,
  element.color = "darkgray",
  main = "Efficient Frontier",
  RAR.text = "SR",
  rf = 0,
  tangent.line = TRUE,
  cex.legend = 0.8,
  chart.assets = TRUE,
  labels.assets = TRUE,
  pch.assets = 21,
  cex.assets = 0.8
)

## S3 method for class 'optimize.portfolio'
chart.EfficientFrontier(
  object,
  ...,
  match.col = "ES",
  n.portfolios = 25,
  xlim = NULL,
  ylim = NULL,
  cex.axis = 0.8,
  element.color = "darkgray",
  main = "Efficient Frontier",
  RAR.text = "SR",
  rf = 0,
  tangent.line = TRUE,
  cex.legend = 0.8,
  chart.assets = TRUE,
  labels.assets = TRUE,
  pch.assets = 21,
  cex.assets = 0.8
)

## S3 method for class 'efficient.frontier'
chart.EfficientFrontier(
  object,
  ...,
  match.col = "ES",
  n.portfolios = NULL,
  xlim = NULL,
  ylim = NULL,
  cex.axis = 0.8,
  element.color = "darkgray",
  main = "Efficient Frontier",
  RAR.text = "SR",
  rf = 0,
  tangent.line = TRUE,
  cex.legend = 0.8,
  chart.assets = TRUE,
  labels.assets = TRUE,
  pch.assets = 21,
  cex.assets = 0.8
)

Arguments

object

object to chart.

...

passthru parameters to plot

optimize_method

the optimize method to get the efficient frontier

match.col

string name of column to use for risk (horizontal axis). match.col must match the name of an objective measure in the objective_measures or opt_values slot in the object created by optimize.portfolio.

n.portfolios

number of portfolios to use to plot the efficient frontier.

xlim

set the x-axis limit, same as in plot.

ylim

set the y-axis limit, same as in plot.

cex.axis

numerical value giving the amount by which the axis should be magnified relative to the default.

element.color

provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc.

main

a main title for the plot.

RAR.text

string name for risk adjusted return text to plot in the legend.

rf

risk free rate. If rf is not null, the maximum Sharpe Ratio or modified Sharpe Ratio tangency portfolio will be plotted.

tangent.line

TRUE/FALSE to plot the tangent line.

cex.legend

numerical value giving the amount by which the legend should be magnified relative to the default.

chart.assets

TRUE/FALSE to include the assets.

labels.assets

TRUE/FALSE to include the asset names in the plot. chart.assets must be TRUE to plot asset names.

pch.assets

plotting character of the assets, same as in plot.

cex.assets

numerical value giving the amount by which the asset points and labels should be magnified relative to the default.

Details

For objects created by optimize.portfolio with 'DEoptim', 'random', or 'pso' specified as the optimize_method:

For objects created by optimize.portfolio with 'ROI' specified as the optimize_method:

Note that trace=TRUE must be specified in optimize.portfolio

GenSA does not return any useable trace information for portfolios tested at each iteration, therfore we cannot extract and chart an efficient frontier.

By default, the tangency portfolio (maximum Sharpe Ratio or modified Sharpe Ratio) will be plotted using a risk free rate of 0. Set rf=NULL to omit this from the plot.

Author(s)

Ross Bennett, Xinran Zhao


[Package PortfolioAnalytics version 2.0.0 Index]