[Returnanalytics-commits] r2497 - pkg/PortfolioAnalytics/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jul 4 01:49:27 CEST 2013
Author: rossbennett34
Date: 2013-07-04 01:49:26 +0200 (Thu, 04 Jul 2013)
New Revision: 2497
Modified:
pkg/PortfolioAnalytics/R/constraints.R
Log:
removing volatility as a constraint type
Modified: pkg/PortfolioAnalytics/R/constraints.R
===================================================================
--- pkg/PortfolioAnalytics/R/constraints.R 2013-07-03 22:49:48 UTC (rev 2496)
+++ pkg/PortfolioAnalytics/R/constraints.R 2013-07-03 23:49:26 UTC (rev 2497)
@@ -187,7 +187,7 @@
#' @param \dots any other passthru parameters to specify constraints
#' @param indexnum if you are updating a specific constraint, the index number in the $objectives list to update
#' @author Ross Bennett
-#' @seealso \code{\link{constraint_v2}}, \code{\link{weight_sum_constraint}}, \code{\link{box_constraint}}, \code{\link{group_constraint}}, \code{\link{turnover_constraint}}, \code{\link{diversification_constraint}}, \code{\link{volatility_constraint}}, \code{\link{position_limit_constraint}}
+#' @seealso \code{\link{constraint_v2}}, \code{\link{weight_sum_constraint}}, \code{\link{box_constraint}}, \code{\link{group_constraint}}, \code{\link{turnover_constraint}}, \code{\link{diversification_constraint}}, \code{\link{position_limit_constraint}}
#' @export
add.constraint <- function(portfolio, type, enabled=FALSE, ..., indexnum=NULL){
# Check to make sure that the portfolio passed in is a portfolio object
@@ -242,11 +242,6 @@
enabled=enabled,
...=...)
},
- # Volatility constraint
- volatility = {tmp_constraint <- volatility_constraint(type=type,
- enabled=enabled,
- ...=...)
- },
# Position limit constraint
position_limit = {tmp_constraint <- position_limit_constraint(type=type,
enabled=enabled,
@@ -606,25 +601,6 @@
return(Constraint)
}
-#' constructor for volatility_constraint
-#'
-#' This function is called by add.constraint when type="volatility" is specified, \code{\link{add.constraint}}
-#' Penalize if portfolio standard deviation deviates from volatility target
-#'
-#' @param type character type of the constraint
-#' @param vol_target target volatilty constraint
-#' @param enabled TRUE/FALSE
-#' @param \dots any other passthru parameters to specify box and/or group constraints
-#' @author Ross Bennett
-#' @export
-volatility_constraint <- function(type, vol_target, enabled=FALSE, ...){
- Constraint <- constraint_v2(type, enabled=enabled, constrclass="volatility_constraint", ...)
- # Constraint$min.vol <- min.vol
- # Constraint$max.vol <- max.vol
- Constraint$vol_target <- vol_target
- return(Constraint)
-}
-
#' constructor for position_limit_constraint
#'
#' This function is called by add.constraint when type="position_limit" is specified, \code{\link{add.constraint}}
More information about the Returnanalytics-commits
mailing list