Learn R Programming

PortfolioAnalytics (version 2.1.0)

optimize.portfolio.parallel: Execute multiple optimize.portfolio calls, presumably in parallel

Description

This function will not speed up optimization!

Usage

optimize.portfolio.parallel(
  R,
  portfolio,
  optimize_method = c("DEoptim", "random", "ROI", "pso", "GenSA", "CVXR"),
  search_size = 20000,
  trace = FALSE,
  ...,
  rp = NULL,
  momentFUN = "set.portfolio.moments",
  message = FALSE,
  nodes = 4
)

Value

a list containing the optimal weights, some summary statistics, the function call, and optionally trace information

Arguments

R

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

portfolio

an object of type "portfolio" specifying the constraints and objectives for the optimization

optimize_method

one of "DEoptim", "random", "pso", "GenSA".

search_size

integer, how many portfolios to test, default 20,000

trace

TRUE/FALSE if TRUE will attempt to return additional information on the path or portfolios searched

...

any other passthru parameters

rp

matrix of random portfolio weights, default NULL, mostly for automated use by rebalancing optimization or repeated tests on same portfolios

momentFUN

the name of a function to call to set portfolio moments, default set.portfolio.moments_v2

message

TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.

nodes

how many processes to run in the foreach loop, default 4

Author

Kris Boudt, Peter Carl, Brian G. Peterson

Details

This function exists to run multiple copies of optimize.portfolio, presumabley in parallel using foreach.

This is typically done to test your parameter settings, specifically total population size, but also possibly to help tune your convergence settings, number of generations, stopping criteria, etc.

If you want to use all the cores on your multi-core computer, use the parallel version of the apppropriate optimization engine, not this function.