update.randportBurSt {PortfolioProbe} | R Documentation

## Re-execute a random portfolio object

### Description

Re-executes a call to `random.portfolio`, possibly with some arguments changed.

### Usage

    update.randportBurSt(object, ..., evaluate = TRUE,
            checkinput = TRUE)

### Arguments

`object` | an object produced by `random.portfolio` (or `random.portfolio.utility`).
`...` | arguments to `random.portfolio` that should be added or changed from those in the initial call.
`evaluate` | logical value. If `TRUE` (the default), then the command is executed. If `FALSE`, then the (revised) call is returned. This argument needs to be given by its full name since it comes after the three-dots in the argument list.
`checkinput` | logical value. If `TRUE` (the default), then a check is made to see if the prices, variance, expected return and the existing portfolio are the same in the new call as the original call. Except that any of these are excluded from the test if they are arguments in the call to `update`. This argument needs to be given by its full name since it comes after the three-dots in the argument list.

### Value

If `evaluate` is `TRUE`, then the possibly revised call is executed, producing a random portfolio object (of class `"randportBurSt"`).

### Details

Arguments that are changed need to use the exact same abbreviation (if any) as the original call. For instance, if in the original call `net.value` is abbreviated to `net.val`, then you need to use `net.val` if you want to change the net value allowed.

The default method of `update` works for the results of `trade.optimizer` so it doesn't need a special method. However, this means that there is no check for the key inputs changing. If you want such a check, then you need to do it yourself as can be seen in the help file for `pprobe.checkinput`.

### Revision

This help was last revised 2010 September 27.

### See Also

`random.portfolio`, `trade.optimizer`, `pprobe.checkinput`.

### Examples

    randport1 <- random.portfolio(100, prices, variance=varian,
            long.only=TRUE, bench.constr=c(spx=.04^2/252),
            lin.constraints=cntrysect.conmat,
            lin.bounds=cntrysect.bounds, gross.value=1e6)

    randport2 <- update(randport1) # same again
    randport3 <- update(randport1, gross.value=1.5e6)

    opt1 <- trade.optimizer(prices, variance=varian,
            long.only=TRUE, bench.constr=c(spx=.04^2/252),
            lin.constraints=cntrysect.conmat,
            lin.bounds=cntrysect.bounds, gross.value=1e6)

    opt2 <- update(opt1, gross.value=1.5e6)

    call1 <- update(opt1, number.rand=100, evaluate=FALSE)
    call1[[1]] <- as.name("random.portfolio")
    randport4 <- eval(call1) # random portfolios like opt1

[Package PortfolioProbe version 1.03 Index]