Description Usage Arguments Details Value Author(s) References Examples
This function computes a measure of the difference between one or more portfolios and a benchmark portfolio.
1 | portfolio.difference(portfolios, x.b, method = c("relative", "absolute"))
|
portfolios |
A numeric vector or matrix that defines the portfolio exposures |
x.b |
A numeric vector that defines the benchmark exposures |
method |
A character value that defines the difference measure |
The absolute deviation between a portfolio \bf{x} and a benchmark \bf{x}_b is denoted by {D_a}≤ft({{\bf{x}},{{\bf{x}}_b}} \right) and is computed as {D_a}≤ft( {{\bf{x}},{{\bf{x}}_b}} \right) = \frac{1}{2}∑\limits_{i = 1}^n {≤ft| {{x_i} - {x_{b,i}}} \right|}.
The relative deviation between a portfolio and a benchmark is denoted by {D_r}≤ft( {{\bf{x}},{{\bf{x}}_b}} \right) and is computed as {D_r}≤ft( {{\bf{x}},{{\bf{x}}_b}} \right) = \frac{1}{n}∑\limits_{i = 1}^n {\frac{{≤ft| {{x_i} - {x_{b,i}}} \right|}}{{{x_i} + {x_{b,i}}}}}.
The private function vector.difference
performs the actual calculation
of the difference based on the given method.
A single numeric measure for one portfolio or a numeric vector for a collection of portfolios
Frederick Novomestky fn334@nyu.edu
Worthington, A. C., 2009. Household Asset Portfolio Diversification: Evidence from the Household, Income and Labour Dynamics in Australia (Hilda) Survey, Working Paper, Available at SSRN: http://ssrn.com/abstract=1421567.
1 2 3 4 | onePortfolio <- random.longonly( 100, 75 )
aBenchmark <- rep( 0.01, 100 )
portfolio.difference( onePortfolio, aBenchmark, method="absolute" )
portfolio.difference( onePortfolio, aBenchmark, method="relative" )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.