Description Usage Arguments Details Value Author(s) References See Also Examples
This function generates a vector of investment weights for a long short portfolio where the the gross notional exposure is x.t.long + x.t.short and the net notional exposure is x.t.long - x.t.short. There are k non-zero positions in the portfolio.
1 2 | random.longshort(n = 2, k = n, segments = NULL, x.t.long = 1, x.t.short = x.t.long,
max.iter = 2000, eps = 0.001)
|
n |
A positive integer value for the number of investments in the portfolio |
k |
A positive integer value for the number of non zero weights |
segments |
A vector or list of vectors that defines the portfolio segments |
x.t.long |
A positive real value for the sum of the long exposures |
x.t.short |
A positive real value for the sum of the absolute value of the short exposures |
max.iter |
A positive integer value for the maximum iterations in the acceptance rejection method |
eps |
A small positive real value for the convergence criteria for the gross notional exposure |
The function implements an algorithm in which the outer structure is the iterative
acceptance rejection method. Within each iteration, the R function random.longonly
is used to construct a long only investment weight vector x.long where the sum of
these weights is x.t.long. The R function random.shortonly is used to construct
a short only investment eight vector random.short such that the sum of the absolute
value of these weights is x.t.long. The sum of these two weight vectors, x.longshort,
satisfies the net notional requirement of the desired portfolio. If the absolute value of
computed gross notiona exposure for x.longshort minus $x.t.long + x.t.short$ is less than
the argument eps, then the desired portfolio is generated and result is returned.
Otherwise, the process is repeated within the acceptance rejection loop until (1) the required
portfolio is generated or 2 the iteration limit is exceeded.
An n \times 1 vector of investment weights for the long short portfolio.
Frederick Novomestky fn334@nyu.edu
Jacobs, B. I. and K. N. Levy, 1997. The Long and Short of Long-Short Investing, Journal of Investing, Spring 1997, 73-86.
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.longonly,
random.shortonly
1 2 3 4 5 6 7 8 | ###
### long short portfolio of 30 investments with 30 non-zero positions
###
x <- random.longshort( 30 )
###
### long short portfolio of 30 investments with 10 non-zero positions
###
y <- random.longshort( 30, 10 )
|
Loading required package: truncdist
Loading required package: stats4
Loading required package: evd
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.