random.longonly.test(n = 2, k = n, segments = NULL, x.t = 1, x.l=0,
x.u = x.t, max.iter = 1000)
Kinderman, A. J. and J. G. Ramage, 1976. Computer Generation of Normal Random Variables, Journal of the American Statistical Association, December 1976, 71(356), 893.
Marsaglia, G. and T. A. Bray, 1964. A Convenient method for generating normal variables, SIAM Review, 6(3), July 1964, 260-264.
Ross, S. M. (2006). Simulation, Fourth Edition, Academic Press, New York NY.
Tadikamalla, P. R., (1978). Computer generation of gamma random variables - II, Communications of the ACM, 21 (11), November 1978, 925-928.
###
### long only portfolio of 30 investments with 30 non-zero positions
###
result.x <- random.longonly.test( 30 )
###
### long only portfolio of 30 investments with 10 non-zero positions
###
result.y <- random.longonly.test( 30, 10 )
Run the code above in your browser using DataLab