trade.optimizer.control {PortfolioProbe} | R Documentation

## Optimizer Controls for Trade Selection

### Description

Sets parameters that control the optimization algorithm in `trade.optimizer` (and hence in `random.portfolio.utility`).

### Usage

    trade.optimizer.control(iterations.max = 20, fail.iter = 0,
            funeval.max = .Machine$integer.max, trace = TRUE,
            exit.obj = -big, doubleconst = FALSE, runs.init = 3,
            runs.final = 2, runs.min = 1, stringency = 0,
            nonconverge.mult = 2, feasible = 0, miniter = 0,
            force.risk.aver = FALSE, enforce.max.weight = TRUE,
            save.iterhistory = FALSE, safe.mode = TRUE, ...)

### Arguments

`iterations.max` | integer giving the maximum number of iterations to perform in a run.
`fail.iter` | integer giving the maximum number of consecutive iterations that fail to improve the solution without the algorithm stopping and declaring that convergence has been achieved. For example, if `fail.iter` is 5, then the algorithm continues with 5 consecutive failures but stops upon the 6th consecutive failure.
`funeval.max` | integer giving the maximum number of function (portfolio) evaluations to perform. The most common use of this is to set it to one or zero when you have a specific trade that you would like to have done.
`trace` | logical value. If `TRUE`, then information on the progress of the optimization is printed. This is ignored under Windows – tracing information is not available on this platform except in BATCH mode.
`exit.obj` | number such that the optimization terminates if the best solution has an objective at least as good (i.e., an objective smaller than or equal to `exit.obj`). (Useful for comparing algorithms, but otherwise probably uninteresting.)
`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).
`runs.init` | if `stringency` is greater than zero, then the maximum number of runs to do on the original problem.
`runs.final` | if `stringency` is greater than zero, then the maximum number of runs to do with the trading universe restricted to those assets that traded in at least one of the initial runs.
`runs.min` | if `stringency` is greater than zero, then the minimum number of runs that are to be performed.
`stringency` | an integer giving one less than the number of runs that need to match as the best solution before the optimization is exited. If `stringency` is 0, then only one run is done. If `stringency` is 1, then the best solution needs to occur twice before the optimization stops. If the best solution does not occur enough times before the maximum number of runs is exhausted, then a final non-convergence run is performed that starts from the best solution found.
`nonconverge.mult` | if `stringency` is greater than zero and the stringency requirement is not met, then a final run is performed starting with the best solution found. `nonconverge.mult` gives the ratio of iterations allowed for this final run relative to the iterations allowed in the others. So if `iterations.max` is 5 and `nonconverge.mult` is 3, then the non-convergence run is allowed up to 15 iterations.
`feasible` | if all constraints are not met at the end of the iteration equal to the value of `feasible`, then the optimization is aborted. But if `feasible` is 0, then the optimization does not stop on account of broken constraints.
`miniter` | the minimum number of iterations to be performed in a run even if `fail.iter` says to stop already.
`force.risk.aver` | logical value which is only used when the `utable` argument is explicitly given and optimization with risk aversion is performed. If `TRUE`, then the `risk.aversion` argument overrides the risk aversion values in the utility table.
`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.
`save.iterhistory` | logical value; if `TRUE`, then a vector of the objective value at each iteration of the optimization will be returned.
`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 function compatible with `random.portfolio.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.

### Revision

This help was last revised 2010 January 02.

### See Also

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

### Examples

    my.to.control <- trade.optimizer.control(iterations=100, fail=5,
            stringency=1, runs.init=5, runs.final=3)
    trade.optimizer(eq.prices, varian, control=my.to.control)

[Package PortfolioProbe version 1.02 Index]