valuation.randportBurSt {PortfolioProbe} | R Documentation

## Monetary Value of Random Portfolios

### Description

Returns one of various concepts of value for the portfolios.

### Usage

    ## S3 method for class 'randportBurSt'
    valuation(x, prices, weight = FALSE,
    	collapse = is.array(prices), type = "gross", cash = NULL,
    	all.assets = FALSE, returns = NULL, cumulative = FALSE)

### Arguments

`x` | required. An object of class `"randportBurSt"` (generally the result of a call to `random.portfolio`).
`prices` | required. A named vector of asset prices that includes at least the assets in the object being evaluated; or a matrix with column names for the assets (rows are for times); or a three-dimensional array with rows corresponding to times, columns to assets, and slices to different scenarios.
`weight` | logical value; if `TRUE`, then the result will contain weights rather than monetary value.
`collapse` | logical value, or an object representing categories. If `TRUE`, then the result will be a vector or matrix containing results for the portfolios rather than individual assets. Categories can be represented by a named character vector or factor, or a list of these (for combinations of categories). The list can be in the form of a data frame where the row names are the asset identifiers.
`type` | this is only used when `collapse` is not `FALSE`. A character string that (partially) matches one of: `"gross"`, `"net"`, `"long"`, `"short"`, `"nav"`, `"cash"`. When this has value `"nav"`, then the result is the net value plus cash. When this has value `"short"`, the result is non-negative numbers. The `"cash"` type lets you see the value of cash that is computed.
`cash` | this is only used when `type="nav"` and `collapse` is not `FALSE` (which includes return calculations). A single number, a numeric vector with as many elements as there are rows in `prices`, or `NULL`. If this is `NULL`, then the amount of cash is such that the initial value is equal to the gross value minus the net value at the first time point for each portfolio.
`all.assets` | a logical value. If `TRUE`, then the `weight` and `individual` components will have the same assets (in the same order) as `prices`.
`returns` | either `NULL` or a single character string that is (an abbreviation of) `"log"`, `"simple"`, `"geometric"`, or `"arithmetic"`. This fails if `prices` is not a matrix or array. This is two types of returns with two names each.
`cumulative` | a logical value. If `TRUE`, then the returns are cumulative – that is, relative to the prices at the first time point. If `FALSE`, then the return at each time point is relative to the immediately previous time point. This is ignored if returns are not produced.

### Value

a list, vector, matrix or three-dimensional array containing valuation information, and with some attributes.

If `collapse` is `FALSE`, then the result is a list of the same length as the input `x` where each component holds the asset valuations or weights.

If `collapse` is `TRUE`, then the result is an object with the same number of dimensions as `prices`, but the dimension in `prices` that corresponds to assets corresponds to random portfolios in the result.

If `collapse` represents categories, then the result has one more dimension than `prices` (and currently `prices` is not allowed to be three-dimensional in this case). The order of dimensions is: time (if any), categories, random portfolios.

The (extra) attributes are:

`timestamp` | character string giving the date and time of the evaluation.
`call` | the call that created the object.

### Details

This is a method for the generic function `valuation` for class `randportBurSt`.

If the portfolios are long-short and the valuations are going to be used to calculate returns, then you should set `type="nav"` and set `cash` properly for the situation that you have.

If `out.trade` is `TRUE` in the call for `x`, then the results are for the trades and not for the portfolios.

### Revision

This help was last revised 2013 April 17.

### See Also

`random.portfolio`, `deport.randportBurSt`, `valuation.portfolBurSt`.

### Examples

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

    randval1 <- valuation(randport1, prices)
    randval1n <- valuation(randport1, new.prices)

    randret <- valuation(randport1, price.matrix, returns="simple")

    # weights by country-sector combination
    randwgt.cntrysect <- valuation(randport1, price.matrix,
    	collapse=list(country, sector), weight=TRUE)

[Package PortfolioProbe version 1.06 Index]