Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

random_portfolios_v1

generate an arbitary number of constrained random portfolios


Description

repeatedly calls randomize_portfolio to generate an arbitrary number of constrained random portfolios.

Usage

random_portfolios_v1(rpconstraints, permutations = 100, ...)

Arguments

rpconstraints

an object of type "constraints" specifying the constraints for the optimization, see constraint

permutations

integer: number of unique constrained random portfolios to generate

...

any other passthru parameters

Value

matrix of random portfolio weights

Author(s)

Peter Carl, Brian G. Peterson, (based on an idea by Pat Burns)

See Also

Examples

rpconstraint<-constraint_v1(assets=10, 
                         min_mult=-Inf, 
                         max_mult=Inf, 
                         min_sum=.99, 
                         max_sum=1.01, 
                         min=.01, 
                         max=.4, 
                         weight_seq=generatesequence())
                         
rp<- random_portfolios_v1(rpconstraints=rpconstraint,permutations=1000)
head(rp)

PortfolioAnalytics

Portfolio Analysis, Including Numerical Methods for Optimization of Portfolios

v1.1.0
GPL-2 | GPL-3
Authors
Brian G. Peterson [cre, aut, cph], Peter Carl [aut, cph], Kris Boudt [ctb, cph], Ross Bennett [ctb, cph], Hezky Varon [ctb], Guy Yollin [ctb], R. Douglas Martin [ctb]
Initial release
2018-05-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.