| trade.distance {PortfolioProbe} | R Documentation |
Returns the trade distance between two portfolios.
trade.distance(x, y, prices = NULL, scale = TRUE, tol = 1e-6)
x |
an object that is the result of |
y |
an object that is the result of |
prices |
a named vector of prices of the assets in the portfolios.
If |
scale |
either a logical value or a string that is (an abbreviation of) one of:
If |
tol |
a single number giving the tolerace for testing if a vector is a weight vector, and the relative tolerance for two prices for the same asset being equal. |
a number. If scaling is done and the gross values of the two portfolios are equal, then the maximum possible is 2.
There is an attribute called "asset.count" which tells the
number of assets unique to x, the number of assets the
portfolios have in common, and the number of assets unique to
y.
This help was last revised 2013 April 13.
op1 <- trade.optimizer(prices, varmat, gross.value=9e7, long.only=TRUE) op2 <- update(op1, seed=NULL) trade.distance(op1, op2) trade.distance(c(ABC=34, DEF=27), c(DEF=28, GHI=83), prices=myPriceVector, scale="weight")