[Returnanalytics-commits] r3286 - in pkg/PortfolioAnalytics: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 16 16:50:19 CET 2013


Author: rossbennett34
Date: 2013-12-16 16:50:18 +0100 (Mon, 16 Dec 2013)
New Revision: 3286

Added:
   pkg/PortfolioAnalytics/man/leverage_exposure_constraint.Rd
Modified:
   pkg/PortfolioAnalytics/DESCRIPTION
   pkg/PortfolioAnalytics/NAMESPACE
   pkg/PortfolioAnalytics/R/constrained_objective.R
   pkg/PortfolioAnalytics/R/optimize.portfolio.R
   pkg/PortfolioAnalytics/man/applyFUN.Rd
   pkg/PortfolioAnalytics/man/constrained_objective.Rd
   pkg/PortfolioAnalytics/man/meanetl.efficient.frontier.Rd
   pkg/PortfolioAnalytics/man/meanvar.efficient.frontier.Rd
   pkg/PortfolioAnalytics/man/optimize.portfolio.Rd
   pkg/PortfolioAnalytics/man/random_portfolios.Rd
   pkg/PortfolioAnalytics/man/rp_grid.Rd
   pkg/PortfolioAnalytics/man/rp_sample.Rd
   pkg/PortfolioAnalytics/man/rp_simplex.Rd
   pkg/PortfolioAnalytics/man/scatterFUN.Rd
Log:
Updating documentation

Modified: pkg/PortfolioAnalytics/DESCRIPTION
===================================================================
--- pkg/PortfolioAnalytics/DESCRIPTION	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/DESCRIPTION	2013-12-16 15:50:18 UTC (rev 3286)
@@ -62,4 +62,3 @@
     'equal.weight.R'
     'inverse.volatility.weight.R'
     'utils.R'
-

Modified: pkg/PortfolioAnalytics/NAMESPACE
===================================================================
--- pkg/PortfolioAnalytics/NAMESPACE	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/NAMESPACE	2013-12-16 15:50:18 UTC (rev 3286)
@@ -34,6 +34,7 @@
 export(is.constraint)
 export(is.objective)
 export(is.portfolio)
+export(leverage_exposure_constraint)
 export(meanetl.efficient.frontier)
 export(meanvar.efficient.frontier)
 export(minmax_objective)

Modified: pkg/PortfolioAnalytics/R/constrained_objective.R
===================================================================
--- pkg/PortfolioAnalytics/R/constrained_objective.R	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/R/constrained_objective.R	2013-12-16 15:50:18 UTC (rev 3286)
@@ -340,6 +340,7 @@
 #' @param normalize TRUE/FALSE whether to normalize results to min/max sum (TRUE), or let the optimizer penalize portfolios that do not conform (FALSE)
 #' @param storage TRUE/FALSE default TRUE for DEoptim with trace, otherwise FALSE. not typically user-called.
 #' @param constraints a v1_constraint object for backwards compatibility with \code{constrained_objective_v1}.
+#' @param env environment of moments calculated in \code{optimize.portfolio}
 #' @seealso \code{\link{constraint}}, \code{\link{objective}}, \code{\link[DEoptim]{DEoptim.control}} 
 #' @author Kris Boudt, Peter Carl, Brian G. Peterson, Ross Bennett
 #' @aliases constrained_objective constrained_objective_v1

Modified: pkg/PortfolioAnalytics/R/optimize.portfolio.R
===================================================================
--- pkg/PortfolioAnalytics/R/optimize.portfolio.R	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/R/optimize.portfolio.R	2013-12-16 15:50:18 UTC (rev 3286)
@@ -989,7 +989,7 @@
   return(out)
 }
 
-#' constrained optimization of portfolios
+#' Constrained optimization of portfolios
 #' 
 #' This function aims to provide a wrapper for constrained optimization of 
 #' portfolios that specify constraints and objectives.
@@ -1022,7 +1022,11 @@
 #' \item{Minimize portfolio variance subject to leverage, box, group, and/or factor exposure constraints and a desired portfolio return.}
 #' \item{Maximize quadratic utility subject to leverage, box, group, target mean return, turnover, and/or factor exposure constraints and risk aversion parameter.
 #' (The risk aversion parameter is passed into \code{optimize.portfolio} as an added argument to the \code{portfolio} object).}
-#' \item{Mean CVaR optimization subject to leverage, box, group, position limit, target mean return, and/or factor exposure constraints and target portfolio return.}
+#' \item{Maximize portfolio mean return per unit standard deviation (i.e. the Sharpe Ratio) can be done by specifying \code{maxSR=TRUE} in \code{optimize.portfolio}. 
+#' If both mean and StdDev are specified as objective names, the default action is to maximize quadratic utility, therefore \code{maxSR=TRUE} must be specified to maximize Sharpe Ratio.}
+#' \item{Minimize portfolio ES/ETL/CVaR optimization subject to leverage, box, group, position limit, target mean return, and/or factor exposure constraints and target portfolio return.}
+#' \item{Maximize portfolio mean return per unit ES/ETL/CVaR (i.e. the STARR Ratio) can be done by specifying \code{maxSTARR=TRUE} in \code{optimize.portfolio}. 
+#' If both mean and ES/ETL/CVaR are specified as objective names, the default action is to maximize mean return per unit ES/ETL/CVaR.}
 #' }
 #' These problems also support a weight_concentration objective where concentration
 #' of weights as measured by HHI is added as a penalty term to the quadratic objective.

Modified: pkg/PortfolioAnalytics/man/applyFUN.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/applyFUN.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/applyFUN.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -2,7 +2,7 @@
 \alias{applyFUN}
 \title{Apply a risk or return function to a set of weights}
 \usage{
-  applyFUN(R, weights, FUN = "mean", ...)
+  applyFUN(R, weights, FUN = "mean", arguments)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -12,7 +12,7 @@
 
   \item{FUN}{name of a function}
 
-  \item{...}{any passthrough arguments to FUN}
+  \item{arguments}{named list of arguments to FUN}
 }
 \description{
   This function is used to calculate risk or return metrics

Modified: pkg/PortfolioAnalytics/man/constrained_objective.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/constrained_objective.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/constrained_objective.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -8,10 +8,12 @@
     trace = FALSE, normalize = TRUE, storage = FALSE)
 
   constrained_objective_v2(w, R, portfolio, ...,
-    trace = FALSE, normalize = TRUE, storage = FALSE)
+    trace = FALSE, normalize = TRUE, storage = FALSE,
+    env = NULL)
 
   constrained_objective(w, R, portfolio, ...,
-    trace = FALSE, normalize = TRUE, storage = FALSE)
+    trace = FALSE, normalize = TRUE, storage = FALSE,
+    env = NULL)
 }
 \arguments{
   \item{R}{an xts, vector, matrix, data frame, timeSeries
@@ -39,6 +41,9 @@
 
   \item{constraints}{a v1_constraint object for backwards
   compatibility with \code{constrained_objective_v1}.}
+
+  \item{env}{environment of moments calculated in
+  \code{optimize.portfolio}}
 }
 \description{
   Function to calculate a numeric return value for a

Added: pkg/PortfolioAnalytics/man/leverage_exposure_constraint.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/leverage_exposure_constraint.Rd	                        (rev 0)
+++ pkg/PortfolioAnalytics/man/leverage_exposure_constraint.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -0,0 +1,50 @@
+\name{leverage_exposure_constraint}
+\alias{leverage_exposure_constraint}
+\title{constructor for leverage_exposure_constraint}
+\usage{
+  leverage_exposure_constraint(type = "leverage_exposure",
+    leverage = NULL, enabled = TRUE, message = FALSE, ...)
+}
+\arguments{
+  \item{type}{character type of the constraint}
+
+  \item{leverage}{maximum leverage value}
+
+  \item{enabled}{TRUE/FALSE}
+
+  \item{message}{TRUE/FALSE. The default is message=FALSE.
+  Display messages if TRUE.}
+
+  \item{\dots}{any other passthru parameters to specify
+  diversification constraint an object of class
+  'diversification_constraint'}
+}
+\description{
+  The leverage_exposure constraint specifies a maximum
+  leverage. This should be used for constructing, for
+  example, 130/30 portfolios or dollar neutral portfolios
+  with 2:1 leverage. For the ROI solvers, this is
+  implemented as a MILP problem and is not supported for
+  problems formulated as a quadratic programming problem.
+  This ma changed in the future if a MIQP solver is added.
+}
+\details{
+  This function is called by add.constraint when
+  type="leverage_exposure" is specified, see
+  \code{\link{add.constraint}}.
+}
+\examples{
+data(edhec)
+ret <- edhec[, 1:4]
+
+pspec <- portfolio.spec(assets=colnames(ret))
+
+pspec <- add.constraint(portfolio=pspec, type="leverage_exposure", leverage=1.6)
+}
+\author{
+  Ross Bennett
+}
+\seealso{
+  \code{\link{add.constraint}}
+}
+

Modified: pkg/PortfolioAnalytics/man/meanetl.efficient.frontier.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/meanetl.efficient.frontier.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/meanetl.efficient.frontier.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -3,7 +3,7 @@
 \title{Generate the efficient frontier for a mean-etl portfolio}
 \usage{
   meanetl.efficient.frontier(portfolio, R,
-    n.portfolios = 25)
+    n.portfolios = 25, ...)
 }
 \arguments{
   \item{portfolio}{a portfolio object with constraints and
@@ -13,6 +13,9 @@
 
   \item{n.portfolios}{number of portfolios to generate the
   efficient frontier}
+
+  \item{\dots}{passthru parameters to
+  \code{\link{optimize.portfolio}}}
 }
 \value{
   a matrix of objective measure values and weights along

Modified: pkg/PortfolioAnalytics/man/meanvar.efficient.frontier.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/meanvar.efficient.frontier.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/meanvar.efficient.frontier.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -3,7 +3,7 @@
 \title{Generate the efficient frontier for a mean-variance portfolio}
 \usage{
   meanvar.efficient.frontier(portfolio, R,
-    n.portfolios = 25, risk_aversion = NULL)
+    n.portfolios = 25, risk_aversion = NULL, ...)
 }
 \arguments{
   \item{portfolio}{a portfolio object with constraints and
@@ -19,6 +19,9 @@
   ignored if \code{risk_aversion} is specified and the
   number of points along the efficient frontier is equal to
   the length of \code{risk_aversion}.}
+
+  \item{\dots}{passthru parameters to
+  \code{\link{optimize.portfolio}}}
 }
 \value{
   a matrix of objective measure values and weights along

Modified: pkg/PortfolioAnalytics/man/optimize.portfolio.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/optimize.portfolio.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/optimize.portfolio.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -2,7 +2,7 @@
 \alias{optimize.portfolio}
 \alias{optimize.portfolio_v1}
 \alias{optimize.portfolio_v2}
-\title{constrained optimization of portfolios}
+\title{Constrained optimization of portfolios}
 \usage{
   optimize.portfolio_v1(R, constraints,
     optimize_method = c("DEoptim", "random", "ROI", "ROI_old", "pso", "GenSA"),
@@ -166,14 +166,26 @@
   turnover, and/or factor exposure constraints and risk
   aversion parameter. (The risk aversion parameter is
   passed into \code{optimize.portfolio} as an added
-  argument to the \code{portfolio} object).} \item{Mean
-  CVaR optimization subject to leverage, box, group,
-  position limit, target mean return, and/or factor
-  exposure constraints and target portfolio return.} }
-  These problems also support a weight_concentration
-  objective where concentration of weights as measured by
-  HHI is added as a penalty term to the quadratic
-  objective.
+  argument to the \code{portfolio} object).} \item{Maximize
+  portfolio mean return per unit standard deviation (i.e.
+  the Sharpe Ratio) can be done by specifying
+  \code{maxSR=TRUE} in \code{optimize.portfolio}. If both
+  mean and StdDev are specified as objective names, the
+  default action is to maximize quadratic utility,
+  therefore \code{maxSR=TRUE} must be specified to maximize
+  Sharpe Ratio.} \item{Minimize portfolio ES/ETL/CVaR
+  optimization subject to leverage, box, group, position
+  limit, target mean return, and/or factor exposure
+  constraints and target portfolio return.} \item{Maximize
+  portfolio mean return per unit ES/ETL/CVaR (i.e. the
+  STARR Ratio) can be done by specifying
+  \code{maxSTARR=TRUE} in \code{optimize.portfolio}. If
+  both mean and ES/ETL/CVaR are specified as objective
+  names, the default action is to maximize mean return per
+  unit ES/ETL/CVaR.} } These problems also support a
+  weight_concentration objective where concentration of
+  weights as measured by HHI is added as a penalty term to
+  the quadratic objective.
 
   Because these convex optimization problem are
   standardized, there is no need for a penalty term. The

Modified: pkg/PortfolioAnalytics/man/random_portfolios.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/random_portfolios.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/random_portfolios.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -7,9 +7,9 @@
     rp_method = "sample", eliminate = TRUE, ...)
 }
 \arguments{
-  \item{portfolio}{an object of type "portfolio" specifying
-  the constraints for the optimization, see
-  \code{\link{constraint}}}
+  \item{portfolio}{an object of class 'portfolio'
+  specifying the constraints for the optimization, see
+  \code{\link{portfolio.spec}}}
 
   \item{permutations}{integer: number of unique constrained
   random portfolios to generate}
@@ -26,9 +26,8 @@
   matrix of random portfolio weights
 }
 \description{
-  repeatedly calls \code{\link{randomize_portfolio}} to
-  generate an arbitrary number of constrained random
-  portfolios.
+  Generate random portfolios using the 'sample', 'simplex',
+  or 'grid' method. See details.
 }
 \details{
   Random portfolios can be generate using one of three
@@ -73,8 +72,7 @@
   be 1/3 or less depending on the other constraints.
 }
 \author{
-  Peter Carl, Brian G. Peterson, Ross Bennett (based on an
-  idea by Pat Burns)
+  Peter Carl, Brian G. Peterson, Ross Bennett
 }
 \seealso{
   \code{\link{portfolio.spec}}, \code{\link{objective}},

Modified: pkg/PortfolioAnalytics/man/rp_grid.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/rp_grid.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/rp_grid.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -2,8 +2,7 @@
 \alias{rp_grid}
 \title{Generate random portfolios based on grid search method}
 \usage{
-  rp_grid(portfolio, permutations = 2000, normalize = TRUE,
-    ...)
+  rp_grid(portfolio, permutations = 2000, normalize = TRUE)
 }
 \arguments{
   \item{portfolio}{an object of class 'portfolio'
@@ -15,8 +14,6 @@
 
   \item{normalize}{TRUE/FALSE to normalize the weghts to
   satisfy min_sum or max_sum}
-
-  \item{\dots}{any passthru parameters. Currently ignored}
 }
 \value{
   matrix of random portfolio weights

Modified: pkg/PortfolioAnalytics/man/rp_sample.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/rp_sample.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/rp_sample.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -2,7 +2,8 @@
 \alias{rp_sample}
 \title{Generate random portfolios using the sample method}
 \usage{
-  rp_sample(portfolio, permutations, ...)
+  rp_sample(portfolio, permutations,
+    max_permutations = 200)
 }
 \arguments{
   \item{portfolio}{an object of type "portfolio" specifying
@@ -12,7 +13,8 @@
   \item{permutations}{integer: number of unique constrained
   random portfolios to generate}
 
-  \item{\dots}{any other passthru parameters}
+  \item{max_permutations}{integer: maximum number of
+  iterations to try for a valid portfolio, default 200}
 }
 \value{
   a matrix of random portfolio weights

Modified: pkg/PortfolioAnalytics/man/rp_simplex.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/rp_simplex.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/rp_simplex.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -2,7 +2,7 @@
 \alias{rp_simplex}
 \title{Generate random portfolios using the simplex method}
 \usage{
-  rp_simplex(portfolio, permutations, fev = 0:5, ...)
+  rp_simplex(portfolio, permutations, fev = 0:5)
 }
 \arguments{
   \item{portfolio}{an object of class 'portfolio'
@@ -13,8 +13,6 @@
   random portfolios to generate}
 
   \item{fev}{scalar or vector for FEV biasing}
-
-  \item{\dots}{any other passthru parameters}
 }
 \value{
   a matrix of random portfolio weights

Modified: pkg/PortfolioAnalytics/man/scatterFUN.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/scatterFUN.Rd	2013-12-16 06:39:40 UTC (rev 3285)
+++ pkg/PortfolioAnalytics/man/scatterFUN.Rd	2013-12-16 15:50:18 UTC (rev 3286)
@@ -2,14 +2,14 @@
 \alias{scatterFUN}
 \title{Apply a risk or return function to asset returns}
 \usage{
-  scatterFUN(R, FUN, ...)
+  scatterFUN(R, FUN, arguments = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
 
   \item{FUN}{name of function}
 
-  \item{...}{any passthrough arguments to FUN}
+  \item{arguments}{named list of arguments to FUN}
 }
 \description{
   This function is used to calculate risk or return metrics



More information about the Returnanalytics-commits mailing list