[Returnanalytics-commits] r2800 - in pkg/PortfolioAnalytics: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Aug 16 19:51:30 CEST 2013
Author: rossbennett34
Date: 2013-08-16 19:51:30 +0200 (Fri, 16 Aug 2013)
New Revision: 2800
Modified:
pkg/PortfolioAnalytics/R/constraints.R
pkg/PortfolioAnalytics/man/add.constraint.Rd
pkg/PortfolioAnalytics/man/box_constraint.Rd
pkg/PortfolioAnalytics/man/constraint.Rd
pkg/PortfolioAnalytics/man/constraint_v2.Rd
pkg/PortfolioAnalytics/man/diversification_constraint.Rd
pkg/PortfolioAnalytics/man/factor_exposure_constraint.Rd
pkg/PortfolioAnalytics/man/group_constraint.Rd
pkg/PortfolioAnalytics/man/position_limit_constraint.Rd
pkg/PortfolioAnalytics/man/return_constraint.Rd
pkg/PortfolioAnalytics/man/turnover_constraint.Rd
pkg/PortfolioAnalytics/man/weight_sum_constraint.Rd
Log:
updating documentation for constraints
Modified: pkg/PortfolioAnalytics/R/constraints.R
===================================================================
--- pkg/PortfolioAnalytics/R/constraints.R 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/R/constraints.R 2013-08-16 17:51:30 UTC (rev 2800)
@@ -154,13 +154,13 @@
#' constructor for class v2_constraint
#'
-#' @param type character type of the constraint to add or update, currently 'weight_sum', 'box', or 'group'
+#' This function is called by the constructor for the specific constraint.
+#'
+#' @param type character type of the constraint to add or update
#' @param assets number of assets, or optionally a named vector of assets specifying seed weights
#' @param ... any other passthru parameters
#' @param constrclass character to name the constraint class
#' @author Ross Bennett
-#' @aliases constraint
-#' @rdname constraint
#' @export
constraint_v2 <- function(type, enabled=TRUE, ..., constrclass="v2_constraint"){
if(!hasArg(type)) stop("you must specify a constraint type")
@@ -181,18 +181,70 @@
#' General interface for adding and/or updating optimization constraints.
#'
-#' This is the main function for adding and/or updating constraints in an object of type \code{\link{portfolio}}.
+#' This is the main function for adding and/or updating constraints to the \code{{portfolio}} object.
#'
-#' Special cases for the weight_sum constraint are "full_investment" and "dollar_nuetral" or "active" with appropriate values set for min_sum and max_sum. see \code{\link{weight_sum_constraint}}
+#' The following constraint types are supported:
+#' \itemize{
+#' \item{\code{weight_sum}, \code{weight}, \code{leverage}}{ Specify constraint on the sum of the weights, see \code{\link{weight_sum_constraint}}}
+#' \item{\code{full_investment}}{ Special case to set \code{min_sum=1} and \code{max_sum=1} of weight sum constraints}
+#' \item{\code{dollar_neutral}, \code{active}}{ Special case to set \code{min_sum=0} and \code{max_sum=0} of weight sum constraints}
+#' \item{\code{box}}{ Specify constraints for the individual asset weights, see \code{\link{box_constraint}}}
+#' \item{\code{long_only}}{ Special case to set \code{min=0} and \code{max=1} of box constraints}
+#' \item{\code{group}}{ Specify a constraint on the sum of weights within groups and the number of assets with non-zero weights in groups, see \code{\link{group_constraint}}}
+#' \item{\code{turnover}}{ Specify a constraint for target turnover. Turnover is calculated from a set of initial weights, see \code{\link{turnover_constraint}}}
+#' \item{\code{diversification}}{ Specify a constraint for target diversification of a set of weights, see \code{\link{diversification_constraint}}}
+#' \item{\code{position_limit}}{ Specify a constraint on the number of positions (i.e. assets with non-zero weights as well as the number of long and short positions, see \code{\link{position_limit_constraint}}}
+#' \item{\code{return}}{ Specify a constraint for target mean return, see \code{\link{return_constraint}}}
+#' \item{\code{factor_exposure}}{ Specify a constraint for risk factor exposures, see \code{\link{factor_exposure_constraint}}}
+#' }
#'
#' @param portfolio an object of class 'portfolio' to add the constraint to, specifying the constraints for the optimization, see \code{\link{portfolio.spec}}
#' @param type character type of the constraint to add or update, currently 'weight_sum' (also 'leverage' or 'weight'), 'box', 'group', 'turnover', 'diversification', 'position_limit', 'return', or 'factor_exposure'
-#' @param enabled TRUE/FALSE
+#' @param enabled TRUE/FALSE. The default is enabled=TRUE.
#' @param message TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.
#' @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
+#' @param indexnum if you are updating a specific constraint, the index number in the $constraints 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{position_limit_constraint}}
+#' @seealso \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}, \code{\link{return_constraint}, \code{\link{factor_exposure_constraint}}
+#' @examples
+#' data(edhec)
+#' returns <- edhec[, 1:4]
+#' fund.names <- colnames(returns)
+#' pspec <- portfolio.spec(assets=fund.names)
+#' # Add the full investment constraint that specifies the weights must sum to 1.
+#' pspec <- add.constraint(portfolio=pspec, type="weight_sum", min_sum=1, max_sum=1)
+#' # The full investment constraint can also be specified with type="full_investment"
+#' pspec <- add.constraint(portfolio=pspec, type="full_investment")
+#'
+#' # Another common constraint is that portfolio weights sum to 0.
+#' pspec <- add.constraint(portfolio=pspec, type="weight_sum", min_sum=0, max_sum=0)
+#' pspec <- add.constraint(portfolio=pspec, type="dollar_neutral")
+#' pspec <- add.constraint(portfolio=pspec, type="active")
+#'
+#' # Add box constraints
+#' pspec <- add.constraint(portfolio=pspec, type="box", min=0.05, max=0.4)
+#'
+#' min and max can also be specified per asset
+#' pspec <- add.constraint(portfolio=pspec, type="box", min=c(0.05, 0, 0.08, 0.1), max=c(0.4, 0.3, 0.7, 0.55))
+#' # A special case of box constraints is long only where min=0 and max=1
+#' # The default action is long only if min and max are not specified
+#' pspec <- add.constraint(portfolio=pspec, type="box")
+#' pspec <- add.constraint(portfolio=pspec, type="long_only")
+#'
+#' # Add group constraints
+#' pspec <- add.constraint(portfolio=pspec, type="group", groups=c(3, 1), group_min=c(0.1, 0.15), group_max=c(0.85, 0.55), group_labels=c("GroupA", "GroupB"), group_pos=c(2, 1))
+#'
+#' # Add position limit constraint such that we have a maximum number of three assets with non-zero weights.
+#' pspec <- add.constraint(portfolio=pspec, type="position_limit", max_pos=3)
+#'
+#' # Add diversification constraint
+#' pspec <- add.constraint(portfolio=pspec, type="diversification", div_target=0.7)
+#'
+#' # Add turnover constraint
+#' pspec <- add.constraint(portfolio=pspec, type="turnover", turnover_target=0.2)
+#'
+#' # Add target mean return constraint
+#' pspec <- add.constraint(portfolio=pspec, type="return", return_target=0.007)
#' @export
add.constraint <- function(portfolio, type, enabled=TRUE, message=FALSE, ..., indexnum=NULL){
# Check to make sure that the portfolio passed in is a portfolio object
@@ -296,6 +348,7 @@
#' constructor for box_constraint.
#'
+#' Box constraints specify the upper and lower bounds on the weights of the assets.
#' This function is called by add.constraint when type="box" is specified. see \code{\link{add.constraint}}
#'
#' @param type character type of the constraint
@@ -416,6 +469,7 @@
#' constructor for group_constraint
#'
+#' Group constraints specify the grouping of the assets, weights of the groups, and number of postions (i.e. non-zero weights) iof the groups.
#' This function is called by add.constraint when type="group" is specified. see \code{\link{add.constraint}}
#'
#' @param type character type of the constraint
@@ -495,14 +549,14 @@
#' constructor for weight_sum_constraint
#'
+#' THe constraint specifies the upper and lower bound that the weights sum to.
#' This function is called by add.constraint when "weight_sum", "leverage", "full_investment", "dollar_neutral", or "active" is specified as the type. see \code{\link{add.constraint}}
-#' This function allows the user to specify the minimum and maximum that the weights sum to
#'
#' Special cases for the weight_sum constraint are "full_investment" and "dollar_nuetral" or "active"
#'
-#' If type="full_investment", min_sum=1 and max_sum=1
+#' If \code{type="full_investment"}, \code{min_sum=1} and \code{max_sum=1}
#'
-#' If type="dollar_neutral" or type="active", min_sum=0, and max_sum=0
+#' If \code{type="dollar_neutral"} or \code{type="active"}, \code{min_sum=0}, and \code{max_sum=0}
#'
#' @param type character type of the constraint
#' @param min_sum minimum sum of all asset weights, default 0.99
@@ -511,6 +565,7 @@
#' @param message TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.
#' @param \dots any other passthru parameters to specify weight_sum constraints
#' @author Ross Bennett
+#' @seealso \code{\link{add.constraint}}
#' @examples
#' data(edhec)
#' ret <- edhec[, 1:4]
@@ -650,11 +705,13 @@
#' constructor for turnover_constraint
#'
-#' This function is called by add.constraint when type="turnover" is specified. see \code{\link{add.constraint}}
-#' This function allows the user to specify a target turnover value
+#' The turnover constraint specifies a target turnover value.
+#' This function is called by add.constraint when type="turnover" is specified, see \code{\link{add.constraint}}.
+#' Turnover is calculated from a set of initial weights.
#'
-#' Note that turnover constraint is currently only supported for global minimum
-#' variance problem with ROI quadprog plugin
+#' Note that with the RO solvers, turnover constraint is currently only
+#' supported for the global minimum variance and quadratic utility problems
+#' with ROI quadprog plugin.
#'
#' @param type character type of the constraint
#' @param turnover_target target turnover value
@@ -662,6 +719,7 @@
#' @param message TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.
#' @param \dots any other passthru parameters to specify box and/or group constraints
#' @author Ross Bennett
+#' @seealso \code{\link{add.constraint}}
#' @examples
#' data(edhec)
#' ret <- edhec[, 1:4]
@@ -678,7 +736,8 @@
#' constructor for diversification_constraint
#'
-#' This function is called by add.constraint when type="diversification" is specified, \code{\link{add.constraint}}
+#' The diversification constraint specifies a target diversification value.
+#' This function is called by add.constraint when type="diversification" is specified, see \code{\link{add.constraint}}.
#'
#' @param type character type of the constraint
#' @param div_target diversification target value
@@ -686,6 +745,7 @@
#' @param message TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.
#' @param \dots any other passthru parameters to specify box and/or group constraints
#' @author Ross Bennett
+#' @seealso \code{\link{add.constraint}}
#' @examples
#' data(edhec)
#' ret <- edhec[, 1:4]
@@ -702,6 +762,7 @@
#' constructor for return_constraint
#'
+#' The return constraint specifes a target mean return value.
#' This function is called by add.constraint when type="return" is specified, \code{\link{add.constraint}}
#'
#' @param type character type of the constraint
@@ -710,6 +771,7 @@
#' @param message TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.
#' @param \dots any other passthru parameters
#' @author Ross Bennett
+#' @seealso \code{\link{add.constraint}}
#' @examples
#' data(edhec)
#' ret <- edhec[, 1:4]
@@ -728,6 +790,7 @@
#'
#' This function is called by add.constraint when type="position_limit" is specified, \code{\link{add.constraint}}
#' Allows the user to specify the maximum number of positions (i.e. number of assets with non-zero weights)
+#' as well as the maximum number of long and short positions.
#'
#' @param type character type of the constraint
#' @param max_pos maximum number of assets with non-zero weights
@@ -737,13 +800,15 @@
#' @param message TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.
#' @param \dots any other passthru parameters to specify position limit constraints
#' @author Ross Bennett
-#' #' @examples
+#' @seealso \code{\link{add.constraint}}
+#' @examples
#' data(edhec)
#' ret <- edhec[, 1:4]
#'
#' pspec <- portfolio.spec(assets=colnames(ret))
#'
#' pspec <- add.constraint(portfolio=pspec, type="position_limit", max_pos=3)
+#' pspec <- add.constraint(portfolio=pspec, type="position_limit", max_pos_long=3, max_pos_short=1)
#' @export
position_limit_constraint <- function(type="position_limit", assets, max_pos=NULL, max_pos_long=NULL, max_pos_short=NULL, enabled=TRUE, message=FALSE, ...){
# Get the length of the assets vector
@@ -793,6 +858,7 @@
#' Constructor for factor exposure constraint
#'
+#' The factor exposure constraint sets upper and lower bounds on exposures to risk factors.
#' This function is called by add.constraint when type="factor_exposure" is specified. see \code{\link{add.constraint}}
#'
#' \code{B} can be either a vector or matrix of risk factor exposures (i.e. betas).
@@ -816,6 +882,7 @@
#' @param message TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.
#' @param \dots any other passthru parameters to specify risk factor exposure constraints
#' @author Ross Bennett
+#' @seealso \code{\link{add.constraint}}
#' @export
factor_exposure_constraint <- function(type="factor_exposure", assets, B, lower, upper, enabled=TRUE, message=FALSE, ...){
# Number of assets
Modified: pkg/PortfolioAnalytics/man/add.constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/add.constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/add.constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -15,7 +15,7 @@
'weight'), 'box', 'group', 'turnover', 'diversification',
'position_limit', 'return', or 'factor_exposure'}
- \item{enabled}{TRUE/FALSE}
+ \item{enabled}{TRUE/FALSE. The default is enabled=TRUE.}
\item{message}{TRUE/FALSE. The default is message=FALSE.
Display messages if TRUE.}
@@ -24,29 +24,97 @@
constraints}
\item{indexnum}{if you are updating a specific
- constraint, the index number in the $objectives list to
+ constraint, the index number in the $constraints list to
update}
}
\description{
This is the main function for adding and/or updating
- constraints in an object of type \code{\link{portfolio}}.
+ constraints to the \code{{portfolio}} object.
}
\details{
- Special cases for the weight_sum constraint are
- "full_investment" and "dollar_nuetral" or "active" with
- appropriate values set for min_sum and max_sum. see
- \code{\link{weight_sum_constraint}}
+ The following constraint types are supported: \itemize{
+ \item{\code{weight_sum}, \code{weight}, \code{leverage}}{
+ Specify constraint on the sum of the weights, see
+ \code{\link{weight_sum_constraint}}}
+ \item{\code{full_investment}}{ Special case to set
+ \code{min_sum=1} and \code{max_sum=1} of weight sum
+ constraints} \item{\code{dollar_neutral}, \code{active}}{
+ Special case to set \code{min_sum=0} and \code{max_sum=0}
+ of weight sum constraints} \item{\code{box}}{ Specify
+ constraints for the individual asset weights, see
+ \code{\link{box_constraint}}} \item{\code{long_only}}{
+ Special case to set \code{min=0} and \code{max=1} of box
+ constraints} \item{\code{group}}{ Specify a constraint on
+ the sum of weights within groups and the number of assets
+ with non-zero weights in groups, see
+ \code{\link{group_constraint}}} \item{\code{turnover}}{
+ Specify a constraint for target turnover. Turnover is
+ calculated from a set of initial weights, see
+ \code{\link{turnover_constraint}}}
+ \item{\code{diversification}}{ Specify a constraint for
+ target diversification of a set of weights, see
+ \code{\link{diversification_constraint}}}
+ \item{\code{position_limit}}{ Specify a constraint on the
+ number of positions (i.e. assets with non-zero weights as
+ well as the number of long and short positions, see
+ \code{\link{position_limit_constraint}}}
+ \item{\code{return}}{ Specify a constraint for target
+ mean return, see \code{\link{return_constraint}}}
+ \item{\code{factor_exposure}}{ Specify a constraint for
+ risk factor exposures, see
+ \code{\link{factor_exposure_constraint}}} }
}
+\examples{
+data(edhec)
+returns <- edhec[, 1:4]
+fund.names <- colnames(returns)
+pspec <- portfolio.spec(assets=fund.names)
+# Add the full investment constraint that specifies the weights must sum to 1.
+pspec <- add.constraint(portfolio=pspec, type="weight_sum", min_sum=1, max_sum=1)
+# The full investment constraint can also be specified with type="full_investment"
+pspec <- add.constraint(portfolio=pspec, type="full_investment")
+
+# Another common constraint is that portfolio weights sum to 0.
+pspec <- add.constraint(portfolio=pspec, type="weight_sum", min_sum=0, max_sum=0)
+pspec <- add.constraint(portfolio=pspec, type="dollar_neutral")
+pspec <- add.constraint(portfolio=pspec, type="active")
+
+# Add box constraints
+pspec <- add.constraint(portfolio=pspec, type="box", min=0.05, max=0.4)
+
+min and max can also be specified per asset
+pspec <- add.constraint(portfolio=pspec, type="box", min=c(0.05, 0, 0.08, 0.1), max=c(0.4, 0.3, 0.7, 0.55))
+# A special case of box constraints is long only where min=0 and max=1
+# The default action is long only if min and max are not specified
+pspec <- add.constraint(portfolio=pspec, type="box")
+pspec <- add.constraint(portfolio=pspec, type="long_only")
+
+# Add group constraints
+pspec <- add.constraint(portfolio=pspec, type="group", groups=c(3, 1), group_min=c(0.1, 0.15), group_max=c(0.85, 0.55), group_labels=c("GroupA", "GroupB"), group_pos=c(2, 1))
+
+# Add position limit constraint such that we have a maximum number of three assets with non-zero weights.
+pspec <- add.constraint(portfolio=pspec, type="position_limit", max_pos=3)
+
+# Add diversification constraint
+pspec <- add.constraint(portfolio=pspec, type="diversification", div_target=0.7)
+
+# Add turnover constraint
+pspec <- add.constraint(portfolio=pspec, type="turnover", turnover_target=0.2)
+
+# Add target mean return constraint
+pspec <- add.constraint(portfolio=pspec, type="return", return_target=0.007)
+}
\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{position_limit_constraint}}
+ \code{\link{position_limit_constraint},
+ \code{\link{return_constraint},
+ \code{\link{factor_exposure_constraint}}
}
Modified: pkg/PortfolioAnalytics/man/box_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/box_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/box_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -34,8 +34,10 @@
constraints}
}
\description{
- This function is called by add.constraint when type="box"
- is specified. see \code{\link{add.constraint}}
+ Box constraints specify the upper and lower bounds on the
+ weights of the assets. This function is called by
+ add.constraint when type="box" is specified. see
+ \code{\link{add.constraint}}
}
\examples{
data(edhec)
Modified: pkg/PortfolioAnalytics/man/constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -1,14 +1,10 @@
\name{constraint}
\alias{constraint}
-\alias{constraint_v2}
\title{constructor for class constraint}
\usage{
constraint(assets = NULL, ..., min, max, min_mult,
max_mult, min_sum = 0.99, max_sum = 1.01,
weight_seq = NULL)
-
- constraint_v2(type, enabled = TRUE, ...,
- constrclass = "v2_constraint")
}
\arguments{
\item{assets}{number of assets, or optionally a named
@@ -38,29 +34,14 @@
\item{weight_seq}{seed sequence of weights, see
\code{\link{generatesequence}}}
-
- \item{type}{character type of the constraint to add or
- update, currently 'weight_sum', 'box', or 'group'}
-
- \item{assets}{number of assets, or optionally a named
- vector of assets specifying seed weights}
-
- \item{...}{any other passthru parameters}
-
- \item{constrclass}{character to name the constraint
- class}
}
\description{
constructor for class constraint
-
- constructor for class v2_constraint
}
\examples{
exconstr <- constraint(assets=10, min_sum=1, max_sum=1, min=.01, max=.35, weight_seq=generatesequence())
}
\author{
Peter Carl and Brian G. Peterson
-
- Ross Bennett
}
Modified: pkg/PortfolioAnalytics/man/constraint_v2.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/constraint_v2.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/constraint_v2.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -7,7 +7,7 @@
}
\arguments{
\item{type}{character type of the constraint to add or
- update, currently 'weight_sum', 'box', or 'group'}
+ update}
\item{assets}{number of assets, or optionally a named
vector of assets specifying seed weights}
@@ -18,7 +18,8 @@
class}
}
\description{
- constructor for class v2_constraint
+ This function is called by the constructor for the
+ specific constraint.
}
\author{
Ross Bennett
Modified: pkg/PortfolioAnalytics/man/diversification_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/diversification_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/diversification_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -19,9 +19,10 @@
and/or group constraints}
}
\description{
- This function is called by add.constraint when
- type="diversification" is specified,
- \code{\link{add.constraint}}
+ The diversification constraint specifies a target
+ diversification value. This function is called by
+ add.constraint when type="diversification" is specified,
+ see \code{\link{add.constraint}}.
}
\examples{
data(edhec)
@@ -34,4 +35,7 @@
\author{
Ross Bennett
}
+\seealso{
+ \code{\link{add.constraint}}
+}
Modified: pkg/PortfolioAnalytics/man/factor_exposure_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/factor_exposure_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/factor_exposure_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -29,9 +29,10 @@
risk factor exposure constraints}
}
\description{
- This function is called by add.constraint when
- type="factor_exposure" is specified. see
- \code{\link{add.constraint}}
+ The factor exposure constraint sets upper and lower
+ bounds on exposures to risk factors. This function is
+ called by add.constraint when type="factor_exposure" is
+ specified. see \code{\link{add.constraint}}
}
\details{
\code{B} can be either a vector or matrix of risk factor
@@ -54,4 +55,7 @@
\author{
Ross Bennett
}
+\seealso{
+ \code{\link{add.constraint}}
+}
Modified: pkg/PortfolioAnalytics/man/group_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/group_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/group_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -35,8 +35,10 @@
group constraints}
}
\description{
- This function is called by add.constraint when
- type="group" is specified. see
+ Group constraints specify the grouping of the assets,
+ weights of the groups, and number of postions (i.e.
+ non-zero weights) iof the groups. This function is called
+ by add.constraint when type="group" is specified. see
\code{\link{add.constraint}}
}
\examples{
Modified: pkg/PortfolioAnalytics/man/position_limit_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/position_limit_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/position_limit_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -32,7 +32,8 @@
type="position_limit" is specified,
\code{\link{add.constraint}} Allows the user to specify
the maximum number of positions (i.e. number of assets
- with non-zero weights)
+ with non-zero weights) as well as the maximum number of
+ long and short positions.
}
\examples{
data(edhec)
@@ -41,8 +42,12 @@
pspec <- portfolio.spec(assets=colnames(ret))
pspec <- add.constraint(portfolio=pspec, type="position_limit", max_pos=3)
+pspec <- add.constraint(portfolio=pspec, type="position_limit", max_pos_long=3, max_pos_short=1)
}
\author{
- Ross Bennett #'
+ Ross Bennett
}
+\seealso{
+ \code{\link{add.constraint}}
+}
Modified: pkg/PortfolioAnalytics/man/return_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/return_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/return_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -18,7 +18,8 @@
\item{\dots}{any other passthru parameters}
}
\description{
- This function is called by add.constraint when
+ The return constraint specifes a target mean return
+ value. This function is called by add.constraint when
type="return" is specified, \code{\link{add.constraint}}
}
\examples{
@@ -32,4 +33,7 @@
\author{
Ross Bennett
}
+\seealso{
+ \code{\link{add.constraint}}
+}
Modified: pkg/PortfolioAnalytics/man/turnover_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/turnover_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/turnover_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -19,15 +19,16 @@
and/or group constraints}
}
\description{
- This function is called by add.constraint when
- type="turnover" is specified. see
- \code{\link{add.constraint}} This function allows the
- user to specify a target turnover value
+ The turnover constraint specifies a target turnover
+ value. This function is called by add.constraint when
+ type="turnover" is specified, see
+ \code{\link{add.constraint}}. Turnover is calculated from
+ a set of initial weights.
}
\details{
- Note that turnover constraint is currently only supported
- for global minimum variance problem with ROI quadprog
- plugin
+ Note that with the RO solvers, turnover constraint is
+ currently only supported for the global minimum variance
+ and quadratic utility problems with ROI quadprog plugin.
}
\examples{
data(edhec)
@@ -40,4 +41,7 @@
\author{
Ross Bennett
}
+\seealso{
+ \code{\link{add.constraint}}
+}
Modified: pkg/PortfolioAnalytics/man/weight_sum_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/weight_sum_constraint.Rd 2013-08-16 16:45:23 UTC (rev 2799)
+++ pkg/PortfolioAnalytics/man/weight_sum_constraint.Rd 2013-08-16 17:51:30 UTC (rev 2800)
@@ -23,21 +23,21 @@
weight_sum constraints}
}
\description{
- This function is called by add.constraint when
- "weight_sum", "leverage", "full_investment",
- "dollar_neutral", or "active" is specified as the type.
- see \code{\link{add.constraint}} This function allows the
- user to specify the minimum and maximum that the weights
- sum to
+ THe constraint specifies the upper and lower bound that
+ the weights sum to. This function is called by
+ add.constraint when "weight_sum", "leverage",
+ "full_investment", "dollar_neutral", or "active" is
+ specified as the type. see \code{\link{add.constraint}}
}
\details{
Special cases for the weight_sum constraint are
"full_investment" and "dollar_nuetral" or "active"
- If type="full_investment", min_sum=1 and max_sum=1
+ If \code{type="full_investment"}, \code{min_sum=1} and
+ \code{max_sum=1}
- If type="dollar_neutral" or type="active", min_sum=0, and
- max_sum=0
+ If \code{type="dollar_neutral"} or \code{type="active"},
+ \code{min_sum=0}, and \code{max_sum=0}
}
\examples{
data(edhec)
@@ -58,4 +58,7 @@
\author{
Ross Bennett
}
+\seealso{
+ \code{\link{add.constraint}}
+}
More information about the Returnanalytics-commits
mailing list