Description Usage Arguments Details Value Author(s) Examples
This function merges a list of portfolios using a specified set of weights. The components in the list can be single portfolio vectors a matrix of portfolios.
1 | portfolio.composite(portfolios, weights = NULL)
|
portfolios |
A list of vectors or matrices corresponding to portfolios of investments |
weights |
A numeric vector of weights for the components |
The private function vector.composite
is used to create a single portfolio
from a list of portfolio weight vectors. The private function matrix.composite
generates the weighted composite matrix from a list of portfolio weight matrices.
A vector or matrix.
Frederick Novomestky fn334@nyu.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | segments <- list()
segments[[1]] <- c( 1, 2, 3 )
segments[[2]] <- c( 4, 5 )
segments[[3]] <- c( 6, 7 )
segments[[4]] <- c( 8, 9, 10 )
weights <- c( .3, .2, .2, .3 )
vectors <- list()
matrices <- list()
for ( i in 1:4 ) {
vectors[[i]] <- random.longonly( 10, segments=segments[[i]] )
matrices[[i]] <- rlongonly( 200, 10, segments=segments[[i]] )
}
combined.vectors <- portfolio.composite( vectors, weights )
combined.matrices <- portfolio.composite( matrices, weights )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.