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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 22 01:22:05 CEST 2013


Author: rossbennett34
Date: 2013-07-22 01:22:05 +0200 (Mon, 22 Jul 2013)
New Revision: 2615

Modified:
   pkg/PortfolioAnalytics/R/random_portfolios.R
Log:
correcting check for feasible portfolio in randomize_portfolio_v2

Modified: pkg/PortfolioAnalytics/R/random_portfolios.R
===================================================================
--- pkg/PortfolioAnalytics/R/random_portfolios.R	2013-07-21 22:40:03 UTC (rev 2614)
+++ pkg/PortfolioAnalytics/R/random_portfolios.R	2013-07-21 23:22:05 UTC (rev 2615)
@@ -297,7 +297,7 @@
   fportfolio <- fn_map(weights=tportfolio, portfolio=portfolio, relax=FALSE)$weights
   
   colnames(fportfolio) <- colnames(seed)
-  if (sum(fportfolio) <= min_sum | sum(fportfolio) >= max_sum){
+  if (sum(fportfolio) < min_sum | sum(fportfolio) > max_sum){
     fportfolio <- seed
     warning("Infeasible portfolio created, defaulting to seed, perhaps increase max_permutations.")
   }



More information about the Returnanalytics-commits mailing list