Learn R Programming

rportfolios (version 1.0-1)

ractive: Generate random active portfolios

Description

This function generates m random actively managed portfolios relative to a given benchmark portfolio. Each portfolio is the combination of a benchmark portfolio and a notional neutral long short portfolio with given gross notional exposure. The number of non zero positions in the long short portfolios is k.

Usage

ractive(m, x.b, x.g, k = length(x.b), segments = NULL, max.iter = 2000, eps = 0.001)

Arguments

m
A positive integer value for the number of portfolios in the sample
x.b
A numeric vector with the investment weights in the benchmark portfolio
x.g
A positive numeric value for the gross notional exposure in the long short portfolio
k
A positive integer value for the number of non zero positions in the long short portfolio
segments
A vector or list of vectors that defines the portfolio segments
max.iter
A positive integer value for the maximum iterations for the long short portfolio
eps
A small positive real value for the convergence criteria for the gross notional exposure

Value

A numeric $m \times n$ matrix. The rows are the portfolios and the columns are the investment weights for each portfolio

Details

The function executes the function random.active using the R function sapply. The result returned is the transpose of the matrix generated in the previous step.

References

Grinold, R. C. and R. H. Kahn, 1999. Active Portfolio Management: Quantitative Approach for Providing Superior Returns and Controlling Risk, Second Edition, McGraw-Hill, New York, NY.

Qian, E. E., R. H. Hua and E. H. Sorensen, 2007. Quantitative Equity Portfolio Management, Chapman \& Hall, London, UK.

Scherer, B., 2007. Portfolio Construction and Risk Budgeting, Third Edition, Risk Books, London, UK.

See Also

random.active

Examples

Run this code
###
### benchmark consists of 20 equally weighted investments
###
x.b <- rep( 1, 30 ) / 30
###
### the gross notional exposure of the long short portfolio is a benchmark weight
###
x.g <- 1 / 30
###
### generate 100 random active portfolios with 30 non zero positions in the long short portfolios
###
x.matrix <- ractive( 100, x.b, x.g )
###
### generate 100 random active portfolios with 10 non zero positions in the long short portfolios
###
y.matrix <- ractive( 100, x.b, x.g, 10 )

Run the code above in your browser using DataLab