rlongshort(m, n = 2, k = n, segments = NULL, x.t.long = 1, x.t.short = x.t.long,
max.iter = 2000, eps = 0.001)
x.t
, x.t.long
and x.t.short
are proportions of total invested capital.
Jacobs, B. I., K. N. Levy and H. M. Markowitz, 2005. Portfolio Optimization with Factors, Scenarios and Realist SHort Positions, Operations Research, July/August 2005, 586-599.
random.longshort
###
### 100 portfolios of 30 investments with 30 non-zero positions
###
x.matrix <- rlongshort( 100, 30 )
###
### 100 portfolios of 30 investments with 10 non-zero positions
###
y.matrix <- rlongshort( 100, 30, 20 )
Run the code above in your browser using DataLab