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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 9 17:32:11 CEST 2014


Author: rossbennett34
Date: 2014-06-09 17:32:11 +0200 (Mon, 09 Jun 2014)
New Revision: 3411

Modified:
   pkg/PortfolioAnalytics/R/charts.risk.R
   pkg/PortfolioAnalytics/R/extractstats.R
   pkg/PortfolioAnalytics/R/optimize.portfolio.R
Log:
fixing a few bugs

Modified: pkg/PortfolioAnalytics/R/charts.risk.R
===================================================================
--- pkg/PortfolioAnalytics/R/charts.risk.R	2014-06-07 15:21:20 UTC (rev 3410)
+++ pkg/PortfolioAnalytics/R/charts.risk.R	2014-06-09 15:32:11 UTC (rev 3411)
@@ -220,7 +220,7 @@
   # Get the objective measures at each rebalance period
   rebal.obj <- extractObjectiveMeasures(object)
   
-  if(inherits(opt.rebal$portfolio, "regime.portfolios")){
+  if(inherits(object$portfolio, "regime.portfolios")){
     # If the optimize.portfolio.rebalancing object is run with regime switching,
     # the output of extractObjectiveMeasures is a list of length N where each
     # element is the objective measures of the corresponding regime. (i.e.

Modified: pkg/PortfolioAnalytics/R/extractstats.R
===================================================================
--- pkg/PortfolioAnalytics/R/extractstats.R	2014-06-07 15:21:20 UTC (rev 3410)
+++ pkg/PortfolioAnalytics/R/extractstats.R	2014-06-09 15:32:11 UTC (rev 3411)
@@ -495,7 +495,7 @@
 extractObjectiveMeasures.optimize.portfolio.rebalancing <- function(object){
   if(!inherits(object, "optimize.portfolio.rebalancing")) stop("object must be of class 'optimize.portfolio.rebalancing'")
   
-  if(inherits(opt.rebal$portfolio, "regime.portfolios")){
+  if(inherits(object$portfolio, "regime.portfolios")){
     result <- extractObjRegime(object)
   } else {
     rebal_object <- object$opt_rebal

Modified: pkg/PortfolioAnalytics/R/optimize.portfolio.R
===================================================================
--- pkg/PortfolioAnalytics/R/optimize.portfolio.R	2014-06-07 15:21:20 UTC (rev 3410)
+++ pkg/PortfolioAnalytics/R/optimize.portfolio.R	2014-06-09 15:32:11 UTC (rev 3411)
@@ -1456,7 +1456,6 @@
   } else {
     rp = NULL
   }
-  print(dim(rp))
   
   if(is.null(training_period)) {if(nrow(R)<36) training_period=nrow(R) else training_period=36}
   if (is.null(trailing_periods)){



More information about the Returnanalytics-commits mailing list