random.portfolio.control {PortfolioProbe} | R Documentation

## Optimizer Controls for Random Portfolios

### Description

Sets parameters that control the optimization of `random.portfolio`.

### Usage

    random.portfolio.control(iterations.max = 20, miniter = 5,
            fail.iter = 5, gen.fail = 4, init.fail = 4,
            throw.error = TRUE,  lockcon = FALSE,
            enforce.max.weight = TRUE, doubleconst = FALSE,
            trace = FALSE, save.iterhistory = FALSE,
            safe.mode = TRUE, ...)

### Arguments

`iterations.max` | integer giving the maximum number of iterations to perform in a single try at a portfolio.
`miniter` | integer giving the minimum number of iterations to be tried in each go even if `fail.iter` says to give up.
`fail.iter` | integer giving the maximum number of consecutive iterations that fail to improve the solution without the algorithm stopping. For example, if `fail.iter` is 3, then the algorithm continues with 3 consecutive failures but stops upon the 4th consecutive failure.
`gen.fail` | integer limiting the total number of failures allowed in a call. The maximum number of failures allowed is `gen.fail` times `number.rand`.
`init.fail` | integer giving the number of failures allowed before the first success at finding a portfolio satisfying all the constraints. If the number of initial failures is violated, then it quits.
`throw.error` | logical value; if `TRUE`, then failing to create any portfolios that satisfy the constraints will cause an error. If `FALSE`, then no error happens and you can tell that no satisfactory portfolios were found because the length of the result is zero.
`lockcon` | logical value; if `TRUE`, then the constraint penalties are used as given. Otherwise the penalties for some constraints may be changed to try to find portfolios more efficiently.
`enforce.max.weight` | logical value; if `TRUE`, then forced trades are automatically created if any positions in the existing portfolio break their maximum weight constraint. This doesn't absolutely guarantee that the constraints will be met, but they generally will be unless the gross value is given a lot of latitude.
`doubleconst` | logical value; if `TRUE`, then any asset which goes from long to short or vice versa in a trade is subject to both intercepts of the trading costs. If `FALSE`, then the first intercept is used but the second is not. This is ignored if `cost.par` is given (or there are no costs).
`trace` | logical value. If `TRUE`, then information on the progress of the search is printed. This is often ignored under Windows.
`save.iterhistory` | logical value; if `TRUE`, then a vector will be returned containing the value of the objective at each iteration of the algorithm for the final random portfolio created.
`safe.mode` | logical value; if `FALSE` (not recommended), then some errors may be bypassed. The reason for this option is to allow possible workarounds for bugs if they appear.
`...` | there are additional arguments that make this compatible with `trade.optimizer.control`.

### Value

a list with the following components:

`icontrol` | vector of the integer-valued control parameters.
`dcontrol` | vector of the double precision control parameters.
`aux` | vector of the auxiliary control parameters.

### Details

ERRORS. Setting the `throw.error` argument to `FALSE` can be useful when doing series of random portfolios, as when imitating a backtest. It can be the case that the desired constraints are infeasible – you can relax some constraints if this proves to be true and try again.

### Revision

This help was last revised 2009 December 29.

### See Also

`random.portfolio`, `random.portfolio.utility`, `trade.optimizer.control`.

### Examples

    # it is unlikely to be useful to call this function directly

[Package PortfolioProbe version 1.02 Index]