Learn R Programming

PortfolioAnalytics (version 2.1.0)

chart.RiskReward: classic risk reward scatter

Description

This function charts the optimize.portfolio object in risk-return space.

Usage

chart.RiskReward(object, ...)

# S3 method for optimize.portfolio.DEoptim chart.RiskReward( object, ..., neighbors = NULL, return.col = "mean", risk.col = "ES", chart.assets = FALSE, element.color = "darkgray", cex.axis = 0.8, xlim = NULL, ylim = NULL )

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

# S3 method for optimize.portfolio.pso chart.RiskReward( object, ..., neighbors = NULL, return.col = "mean", risk.col = "ES", chart.assets = FALSE, element.color = "darkgray", cex.axis = 0.8, xlim = NULL, ylim = NULL )

# S3 method for optimize.portfolio.ROI chart.RiskReward( object, ..., neighbors = NULL, return.col = "mean", risk.col = "ES", chart.assets = FALSE, element.color = "darkgray", cex.axis = 0.8, xlim = NULL, ylim = NULL, rp = FALSE )

# S3 method for optimize.portfolio.random chart.RiskReward( object, ..., neighbors = NULL, return.col = "mean", risk.col = "ES", chart.assets = FALSE, element.color = "darkgray", cex.axis = 0.8, xlim = NULL, ylim = NULL )

# S3 method for opt.list chart.RiskReward( object, ..., risk.col = "ES", return.col = "mean", main = "", ylim = NULL, xlim = NULL, labels.assets = TRUE, chart.assets = FALSE, pch.assets = 1, cex.assets = 0.8, cex.axis = 0.8, cex.lab = 0.8, colorset = NULL, element.color = "darkgray" )

Arguments

object

optimal portfolio created by optimize.portfolio.

...

any other passthru parameters.

neighbors

set of 'neighbor' portfolios to overplot, see Details.

return.col

string matching the objective of a 'return' objective, on vertical axis.

risk.col

string matching the objective of a 'risk' objective, on horizontal axis.

chart.assets

TRUE/FALSE. Includes a risk reward scatter of the assets in the chart.

element.color

color for the default plot scatter points.

cex.axis

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

xlim

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

ylim

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

rp

TRUE/FALSE to generate random portfolios to plot the feasible space

main

a main title for the plot.

labels.assets

TRUE/FALSE to include the names in the plot.

pch.assets

plotting character of the assets, same as in plot

cex.assets

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

cex.lab

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

colorset

color palette or vector of colors to use.

Details

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.

See Also

optimize.portfolio