| valuation.randportBurSt {PortfolioProbe} | R Documentation |
Returns one of various concepts of value for the portfolios.
## 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)
x |
required. An object of class |
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 |
collapse |
logical value, or an object representing categories.
If 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 A character string that (partially) matches one of:
|
cash |
this is only used when A single number, a numeric vector with as many elements as there are
rows in |
all.assets |
a logical value.
If |
returns |
either |
cumulative |
a logical value.
If This is ignored if returns are not produced. |
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. |
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.
This help was last revised 2013 April 17.
random.portfolio, deport.randportBurSt,
valuation.portfolBurSt.
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)