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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jul 20 21:37:45 CEST 2013


Author: rossbennett34
Date: 2013-07-20 21:37:45 +0200 (Sat, 20 Jul 2013)
New Revision: 2608

Modified:
   pkg/PortfolioAnalytics/R/constraints.R
Log:
allow user to specify long only constraints by specifying type=long_only

Modified: pkg/PortfolioAnalytics/R/constraints.R
===================================================================
--- pkg/PortfolioAnalytics/R/constraints.R	2013-07-20 19:31:08 UTC (rev 2607)
+++ pkg/PortfolioAnalytics/R/constraints.R	2013-07-20 19:37:45 UTC (rev 2608)
@@ -209,6 +209,15 @@
                                                  message=message,
                                                  ...=...)
          },
+         # special case of box constraints for long_only
+         long_only = {tmp_constraint <- box_constraint(assets=assets,
+                                                       type=type,
+                                                       enabled=enabled,
+                                                       message=message,
+                                                       min=0,
+                                                       max=1,
+                                                       ...=...)
+         },
          # Group constraints
          group = {tmp_constraint <- group_constraint(assets=assets, 
                                                      type=type,



More information about the Returnanalytics-commits mailing list