| valuation.portfolBurSt {PortfolioProbe} | R Documentation |
Returns various concepts of value.
## S3 method for class 'portfolBurSt' valuation(x, prices = x$prices, trade = FALSE, weight = is.logical(collapse) && !collapse, collapse = is.array(prices), type = "gross", cash = NULL, all.assets = FALSE, returns = NULL, cumulative = FALSE, drop.factor = FALSE) ## Default S3 method: valuation(x, prices, weight = is.logical(collapse) && !collapse, collapse = is.array(prices), type = "gross", cash = NULL, all.assets = FALSE, returns = NULL, cumulative = FALSE, drop.factor = FALSE)
x |
required.
An object of class |
prices |
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. This is a required argument for the default method. |
trade |
logical value.
If |
weight |
logical value; if 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. |
drop.factor |
a logical value.
If |
if collapse is TRUE, then an object with dimension one
less than prices.
The order of the dimensions is: time (if any), and scenarios (if any).
If collapse represents categories, then an object with the
same number of dimensions as prices
(and currently prices
is not allowed to be three-dimensional in this case).
The order of dimensions is: time (if any) and categories.
The above include the attributes timestamp and
call like the descriptions given below.
If collapse is FALSE, a list with the following components:
individual |
the amount of money in individual assets. |
total |
length 4 vector containing the gross value, the net value, the long value and the short value. |
weight |
only present if the |
timestamp |
character string giving the time and date of the evaluation. |
call |
the call that created the object. |
These are methods for the generic function valuation.
This help was last revised 2013 April 17.
trade.optimizer, summary.portfolBurSt,
valuation.randportBurSt.
op1 <- trade.optimizer(eq.prices, varian, long.only=TRUE, gross.value=1e6) valuation(op1) valuation(op1, new.prices) # valuation with new prices valuation(op1, rbind(eq.prices, new.prices)) # two gross values valuation(op1, trade=TRUE) # valuation for the trade valuation(op1$trade, eq.prices) # same thing # get weight vector corresponding to full universe of assets valuation(op1, pricevec, all.assets=TRUE)$weight # log returns over some time period valuation(op1, price.matrix, returns="log")