optimize.portfolio
Scatter and weights chart for portfolio optimizations run with trace=TRUE
# S3 method for 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 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 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 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 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 optimize.portfolio
plot(
x,
...,
return.col = "mean",
risk.col = "ES",
chart.assets = FALSE,
neighbors = NULL,
xlim = NULL,
ylim = NULL,
main = "optimized portfolio plot"
)
set of portfolios created by optimize.portfolio
any other passthru parameters
string name of column to use for returns (vertical axis)
string name of column to use for risk (horizontal axis)
TRUE/FALSE to include risk-return scatter of assets
set of 'neighbor portfolios to overplot
an overall title for the plot: see title
set the limit on coordinates for the x-axis
set the limit on coordinates for the y-axis
TRUE/FALSE to plot feasible portfolios generated by random_portfolios
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.
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.