[Returnanalytics-commits] r3145 - pkg/PortfolioAnalytics/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 20 07:16:14 CEST 2013


Author: rossbennett34
Date: 2013-09-20 07:16:14 +0200 (Fri, 20 Sep 2013)
New Revision: 3145

Modified:
   pkg/PortfolioAnalytics/R/random_portfolios.R
Log:
Correcting number of random numbers to generate for rp_simplex.

Modified: pkg/PortfolioAnalytics/R/random_portfolios.R
===================================================================
--- pkg/PortfolioAnalytics/R/random_portfolios.R	2013-09-20 04:34:38 UTC (rev 3144)
+++ pkg/PortfolioAnalytics/R/random_portfolios.R	2013-09-20 05:16:14 UTC (rev 3145)
@@ -483,7 +483,7 @@
   k <- ceiling(permutations / length(fev))
   
   # generate uniform[0, 1] random numbers
-  U <- runif(n=k*permutations, 0, 1)
+  U <- runif(n=k*length(fev)*nassets, 0, 1)
   Umat <- matrix(data=U, nrow=k, ncol=nassets)
   
   # do the transformation to the set of weights to satisfy lower bounds



More information about the Returnanalytics-commits mailing list