plot.optimize.portfolio.DEoptim {PortfolioAnalytics}R Documentation

plot method for objects of class optimize.portfolio

Description

Scatter and weights chart for portfolio optimizations run with trace=TRUE

Usage

## S3 method for class 'optimize.portfolio.DEoptim'
plot(
  x,
  ...,
  return.col = "mean",
  risk.col = "ES",
  chart.assets = FALSE,
  neighbors = NULL,
  main = "optimized portfolio plot",
  xlim = NULL,
  ylim = NULL
)

## S3 method for class 'optimize.portfolio.GenSA'
plot(
  x,
  ...,
  rp = FALSE,
  return.col = "mean",
  risk.col = "ES",
  chart.assets = FALSE,
  cex.axis = 0.8,
  element.color = "darkgray",
  neighbors = NULL,
  main = "GenSA.Portfolios",
  xlim = NULL,
  ylim = NULL
)

## S3 method for class 'optimize.portfolio.pso'
plot(
  x,
  ...,
  return.col = "mean",
  risk.col = "ES",
  chart.assets = FALSE,
  cex.axis = 0.8,
  element.color = "darkgray",
  neighbors = NULL,
  main = "PSO.Portfolios",
  xlim = NULL,
  ylim = NULL
)

## S3 method for class 'optimize.portfolio.ROI'
plot(
  x,
  ...,
  rp = FALSE,
  risk.col = "ES",
  return.col = "mean",
  chart.assets = FALSE,
  element.color = "darkgray",
  neighbors = NULL,
  main = "ROI.Portfolios",
  xlim = NULL,
  ylim = NULL
)

## S3 method for class 'optimize.portfolio.random'
plot(
  x,
  ...,
  return.col = "mean",
  risk.col = "ES",
  chart.assets = FALSE,
  neighbors = NULL,
  xlim = NULL,
  ylim = NULL,
  main = "optimized portfolio plot"
)

## S3 method for class 'optimize.portfolio'
plot(
  x,
  ...,
  return.col = "mean",
  risk.col = "ES",
  chart.assets = FALSE,
  neighbors = NULL,
  xlim = NULL,
  ylim = NULL,
  main = "optimized portfolio plot"
)

Arguments

x

set of portfolios created by optimize.portfolio

...

any other passthru parameters

return.col

string name of column to use for returns (vertical axis)

risk.col

string name of column to use for risk (horizontal axis)

chart.assets

TRUE/FALSE to include risk-return scatter of assets

neighbors

set of 'neighbor portfolios to overplot

main

an overall title for the plot: see title

xlim

set the limit on coordinates for the x-axis

ylim

set the limit on coordinates for the y-axis

rp

TRUE/FALSE to plot feasible portfolios generated by random_portfolios

cex.axis

the magnification to be used for axis annotation relative to the current setting of cex.

element.color

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

Details

return.col must be the name of a function used to compute the return metric on the random portfolio weights risk.col must be the name of a function used to compute the risk metric on the random portfolio weights

neighbors may be specified in three ways. The first is as a single number of neighbors. This will extract the neighbors closest 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 risk.col,return.col, and weights columns all properly named.

The ROI and GenSA solvers do not store the portfolio weights like DEoptim or random portfolios, random portfolios can be generated for the scatter plot with the rp argument.


[Package PortfolioAnalytics version 2.0.0 Index]