random.equal: Random equal weighted portfolios

Description Usage Arguments Details Value Author(s) Examples

Description

This function generates a random portfolio of n investments in which there are only k positive equal weights. The weights sum to the given value x_t.

Usage

1
random.equal(n = 2, k = n, segments = NULL, x.t = 1)

Arguments

n

A positive integer for the number of investments in the portfolio

k

A positive integer for the number of investments with positive equal weights

segments

A vector or list of vectors that defines the portfolio segments

x.t

A positive numeric value for the sum of weights

Details

The R function sample is used to generate a simple random sample without replacement of k values from the integers 1,2, … ,n. These are the subscripts into an n \times 1 zero vector to assign the equal weight x_t / k.

Value

An n \times 1 numeric vector of investment weights for the equal weighted portfolio. The weights are proportions of invested capital.

Author(s)

Frederick Novomestky fn334@nyu.edu

Examples

1
x <- random.equal( 30, 5 )

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