[Returnanalytics-commits] r2410 - pkg/PortfolioAnalytics/sandbox

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 23 20:42:34 CEST 2013


Author: rossbennett34
Date: 2013-06-23 20:42:33 +0200 (Sun, 23 Jun 2013)
New Revision: 2410

Modified:
   pkg/PortfolioAnalytics/sandbox/testing_portfolio_specification.R
Log:
added example for testing the portfolio spec

Modified: pkg/PortfolioAnalytics/sandbox/testing_portfolio_specification.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/testing_portfolio_specification.R	2013-06-23 18:37:24 UTC (rev 2409)
+++ pkg/PortfolioAnalytics/sandbox/testing_portfolio_specification.R	2013-06-23 18:42:33 UTC (rev 2410)
@@ -27,8 +27,14 @@
                         min_sum=0.99, max_sum=1.01)
 print(pspec)
 
+# Forgot to enable the weight_sum constraint
+pspec <- add.constraint(portfolio=pspec, type="weight_sum",
+                        min_sum=0.99, max_sum=1.01, enabled=TRUE,
+                        indexnum=1)
+print(pspec)
+
 # Add box constraints to the pspec object
-pspec <- add.constraint(portfolio=pspec, type="box", min=0.1, max=0.4)
+pspec <- add.constraint(portfolio=pspec, type="box", min=0.1, max=0.4, enabled=TRUE)
 print(pspec)
 
 # Update the box constraints to pass in a vector for min and max. Updates the



More information about the Returnanalytics-commits mailing list