Execute multiple optimize.portfolio calls, presumably in parallel

Share:

Description

This function will not speed up optimization!

Usage

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

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

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.

Value

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

Author(s)

Kris Boudt, Peter Carl, Brian G. Peterson

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.