rshortonly.test: Generate random short only portfolios

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function generates m random short only portfolios with n investments where each investment absolute weight bounded in an interval and the sum of the absolute weights equals a given amount. This function is used to test the algorithm that generates the random portfolios. The number of non zero positions in the portfolio is k. The function is used to evaluate the performance of the portfolio generation algorithm.

Usage

1
2
rshortonly.test(m, n = 2, k = n, segments = NULL, x.t = 1, x.l = 0, 
x.u = x.t, max.iter = 1000)

Arguments

m

A positive integer value for the number of portfolios

n

An integer value for the number of investments in the portfolio

k

An integer value for the number of non zero weights

segments

A vector or list of vectors that define the portfolio segments

x.t

Numeric value for the sum of the absolute value of the investment weights

x.l

Numeric value for the lower bound on the absolute value of an investment weight

x.u

Numeric value for the upper bound on the absolute value of an investment weight

max.iter

An integer value for the maximum iteration in the acceptance rejection loop

Details

The function executes the function random.shortonly.test using the R function lapply. The result which is a list contains the investment weight vectors and number of iterations. Thse data are stored in a matrix of investment weights and a vector of iterations. These arrays are returned as a list.

Value

A list with two named components.

xmatrix

An m \times n numerical matrix of investment weights

iters

An m \times 1 integer vector for the number of iterations used to obtain the investment weights

Author(s)

Frederick Novomestky fn334@nyu.edu

See Also

random.longonly.test

Examples

1
2
3
4
5
6
7
8
###
### generate 100 short only portfolios of 30 investments with 30 non zero positions
###
x.result <- rshortonly.test( 100, 30 )
###
### generate 100 short only portfolios of 30 investments with 10 non zero positions
###
x.result <- rshortonly.test( 100, 30, 10 )

rportfolios documentation built on May 2, 2019, 3:40 p.m.