rshortonly: Generate 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 with each investment absolute weight bounded in an interval and the sum of the absolute value of weights equals a given amount.

Usage

1
2
rshortonly(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

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

A positive numeric value for the sum of the absolute value of investment weights

x.l

A positive numeric value for the lower bound on the absolute value of investment weights

x.u

A positive numeric value for the upper bound on the absolute value of investment weights

max.iter

A positive integer value for the maximum iterations in the rejection method

Details

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

Value

A numeric imes n matrix. The rows are the portfolios and the columns are the investment weights for each portfolio

Author(s)

Frederick Novomestky fn334@nyu.edu

See Also

random.shortonly

Examples

1
2
x.matrix <- rshortonly( 100, 30 )
y.matrix <- rshortonly( 100, 30, 10 )

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