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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 11 13:20:33 CEST 2013


Author: rossbennett34
Date: 2013-07-11 13:20:33 +0200 (Thu, 11 Jul 2013)
New Revision: 2541

Modified:
   pkg/PortfolioAnalytics/R/random_portfolios.R
Log:
fixing error in randommize_portfolio_v2

Modified: pkg/PortfolioAnalytics/R/random_portfolios.R
===================================================================
--- pkg/PortfolioAnalytics/R/random_portfolios.R	2013-07-11 11:13:54 UTC (rev 2540)
+++ pkg/PortfolioAnalytics/R/random_portfolios.R	2013-07-11 11:20:33 UTC (rev 2541)
@@ -214,9 +214,9 @@
   # get the constraints from the portfolio object
   constraints <- get_constraints(portfolio)
   
-  min_mult <- pconstraints$min_mult
+  min_mult <- constraints$min_mult
   if(is.null(min_mult)) min_mult <- rep(-Inf,nassets)
-  max_mult <- rpconstraints$max_mult
+  max_mult <- constraints$max_mult
   if(is.null(max_mult)) max_mult <- rep(Inf,nassets)
   min_sum  <- constraints$min_sum
   max_sum  <- constraints$max_sum
@@ -225,8 +225,8 @@
     weight_seq <- generatesequence(min=min(constraints$min), max=max(constraints$max), by=0.002)
   }
   weight_seq <- as.vector(weight_seq)
-  max <- rpconstraints$max
-  min <- rpconstraints$min
+  max <- constraints$max
+  min <- constraints$min
   portfolio <- as.vector(seed)
   rownames(portfolio) <- NULL
   



More information about the Returnanalytics-commits mailing list