[Returnanalytics-commits] r2074 - in pkg/PortfolioAnalytics: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jun 25 22:15:18 CEST 2012
Author: braverock
Date: 2012-06-25 22:15:18 +0200 (Mon, 25 Jun 2012)
New Revision: 2074
Modified:
pkg/PortfolioAnalytics/DESCRIPTION
pkg/PortfolioAnalytics/NAMESPACE
pkg/PortfolioAnalytics/R/moment.functions.R
pkg/PortfolioAnalytics/R/optimize.portfolio.R
pkg/PortfolioAnalytics/R/random_portfolios.R
pkg/PortfolioAnalytics/R/trailingFUN.R
pkg/PortfolioAnalytics/man/CCCgarch.MM.Rd
pkg/PortfolioAnalytics/man/add.objective.Rd
pkg/PortfolioAnalytics/man/chart.Scatter.DE.Rd
pkg/PortfolioAnalytics/man/chart.Scatter.RP.Rd
pkg/PortfolioAnalytics/man/chart.Weights.DE.Rd
pkg/PortfolioAnalytics/man/chart.Weights.RP.Rd
pkg/PortfolioAnalytics/man/charts.DE.Rd
pkg/PortfolioAnalytics/man/charts.RP.Rd
pkg/PortfolioAnalytics/man/constrained_objective.Rd
pkg/PortfolioAnalytics/man/constraint.Rd
pkg/PortfolioAnalytics/man/extract.efficient.frontier.Rd
pkg/PortfolioAnalytics/man/extractStats.Rd
pkg/PortfolioAnalytics/man/extractStats.optimize.portfolio.DEoptim.Rd
pkg/PortfolioAnalytics/man/extractStats.optimize.portfolio.parallel.Rd
pkg/PortfolioAnalytics/man/extractStats.optimize.portfolio.random.Rd
pkg/PortfolioAnalytics/man/extractWeights.rebal.Rd
pkg/PortfolioAnalytics/man/generatesequence.Rd
pkg/PortfolioAnalytics/man/is.constraint.Rd
pkg/PortfolioAnalytics/man/is.objective.Rd
pkg/PortfolioAnalytics/man/name.replace.Rd
pkg/PortfolioAnalytics/man/objective.Rd
pkg/PortfolioAnalytics/man/optimize.portfolio.Rd
pkg/PortfolioAnalytics/man/optimize.portfolio.parallel.Rd
pkg/PortfolioAnalytics/man/optimize.portfolio.rebalancing.Rd
pkg/PortfolioAnalytics/man/plot.optimize.portfolio.DEoptim.Rd
pkg/PortfolioAnalytics/man/plot.optimize.portfolio.Rd
pkg/PortfolioAnalytics/man/plot.optimize.portfolio.random.Rd
pkg/PortfolioAnalytics/man/portfolio_risk_objective.Rd
pkg/PortfolioAnalytics/man/random_portfolios.Rd
pkg/PortfolioAnalytics/man/random_walk_portfolios.Rd
pkg/PortfolioAnalytics/man/randomize_portfolio.Rd
pkg/PortfolioAnalytics/man/return_objective.Rd
pkg/PortfolioAnalytics/man/risk_budget_objective.Rd
pkg/PortfolioAnalytics/man/set.portfolio.moments.Rd
pkg/PortfolioAnalytics/man/summary.optimize.portfolio.rebalancing.Rd
pkg/PortfolioAnalytics/man/trailingFUN.Rd
pkg/PortfolioAnalytics/man/update.constraint.Rd
Log:
- update NAMESPACE
- update roxygen docs
- add contributors
- bump version
Modified: pkg/PortfolioAnalytics/DESCRIPTION
===================================================================
--- pkg/PortfolioAnalytics/DESCRIPTION 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/DESCRIPTION 2012-06-25 20:15:18 UTC (rev 2074)
@@ -2,13 +2,14 @@
Type: Package
Title: Portfolio Analysis, including Numeric Methods for Optimization
of Portfolios
-Version: 0.7.2
-Date: 2012-06-21
+Version: 0.8.0
+Date: 2012-06-25
Author: Kris Boudt, Peter Carl, Brian G. Peterson
+Contributors: Hezky Varon, Guy Yollin
Maintainer: Brian G. Peterson <brian at braverock.com>
Description: Portfolio optimization and analysis routines and graphics.
Depends:
- R (>= 2.9.0),
+ R (>= 2.14.0),
zoo,
xts (>= 0.8),
PerformanceAnalytics (>= 1.0.0)
Modified: pkg/PortfolioAnalytics/NAMESPACE
===================================================================
--- pkg/PortfolioAnalytics/NAMESPACE 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/NAMESPACE 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,33 +1,34 @@
-export(chart.Weights.DE)
+export(.)
+export(CCCgarch.MM)
export(chart.Scatter.DE)
+export(chart.Scatter.RP)
export(charts.DE)
-export(plot.optimize.portfolio.DEoptim)
+export(charts.RP)
+export(chart.Weights.DE)
export(chart.Weights.RP)
-export(chart.Scatter.RP)
-export(charts.RP)
-export(plot.optimize.portfolio.random)
-export(plot.optimize.portfolio)
export(constrained_objective)
-export(constraint)
-export(is.constraint)
+export(constraint_ROI)
export(extract.efficient.frontier)
export(extractStats)
export(extractStats.optimize.portfolio.DEoptim)
export(extractStats.optimize.portfolio.parallel)
export(extractStats.optimize.portfolio.random)
export(extractWeights.rebal)
-export(summary.optimize.portfolio.rebalancing)
-export(objective)
+export(generatesequence)
+export(is.constraint)
export(is.objective)
-export(add.objective)
-export(return_objective)
-export(portfolio_risk_objective)
-export(risk_budget_objective)
export(optimize.portfolio)
+export(optimize.portfolio.parallel)
export(optimize.portfolio.rebalancing)
-export(optimize.portfolio.parallel)
-export(generatesequence)
+export(plot.optimize.portfolio)
+export(plot.optimize.portfolio.DEoptim)
+export(plot.optimize.portfolio.random)
+export(portfolio_risk_objective)
export(randomize_portfolio)
+export(random_portfolios)
export(random_walk_portfolios)
-export(random_portfolios)
+export(return_objective)
+export(risk_budget_objective)
+export(set.portfolio.moments)
+export(summary.optimize.portfolio.rebalancing)
export(trailingFUN)
Modified: pkg/PortfolioAnalytics/R/moment.functions.R
===================================================================
--- pkg/PortfolioAnalytics/R/moment.functions.R 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/R/moment.functions.R 2012-06-25 20:15:18 UTC (rev 2074)
@@ -18,6 +18,7 @@
#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
#' @param momentargs list containing arguments to be passed down to lower level functions, default NULL
#' @param \dots any other passthru parameters
+#' @export
CCCgarch.MM = function(R, momentargs = NULL , ... )
{
stopifnot("package:fGarch" %in% search() || require("fGarch",quietly=TRUE))
@@ -64,6 +65,7 @@
#' @param constraints an object of type "constraints" specifying the constraints for the optimization, see \code{\link{constraint}}
#' @param momentargs list containing arguments to be passed down to lower level functions, default NULL
#' @param \dots any other passthru parameters
+#' @export
set.portfolio.moments <- function(R, constraints, momentargs=NULL,...){
if(!hasArg(momentargs) | is.null(momentargs)) momentargs<-list()
@@ -151,4 +153,4 @@
}
###############################################################################
# $Id$
-###############################################################################
\ No newline at end of file
+###############################################################################
Modified: pkg/PortfolioAnalytics/R/optimize.portfolio.R
===================================================================
--- pkg/PortfolioAnalytics/R/optimize.portfolio.R 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/R/optimize.portfolio.R 2012-06-25 20:15:18 UTC (rev 2074)
@@ -348,7 +348,7 @@
#' @param trace TRUE/FALSE if TRUE will attempt to return additional information on the path or portfolios searched
#' @param \dots any other passthru parameters
#' @param nodes how many processes to run in the foreach loop, default 4
-#' .
+#'
#' @return a list containing the optimal weights, some summary statistics, the function call, and optionally trace information
#' @author Kris Boudt, Peter Carl, Brian G. Peterson
#' @export
Modified: pkg/PortfolioAnalytics/R/random_portfolios.R
===================================================================
--- pkg/PortfolioAnalytics/R/random_portfolios.R 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/R/random_portfolios.R 2012-06-25 20:15:18 UTC (rev 2074)
@@ -37,7 +37,6 @@
#' @author Peter Carl, Brian G. Peterson
#' @seealso \code{\link{constraint}}, \code{\link{objective}}
#' @export
-#' .
generatesequence <- function (min=.01, max=1, by=min/max, rounding=3 )
{
# this creates the sequence of possible weights, not constrained by asset
@@ -55,7 +54,6 @@
#' @return named weighting vector
#' @author Peter Carl, Brian G. Peterson, (based on an idea by Pat Burns)
#' @export
-#' .
randomize_portfolio <- function (rpconstraints, max_permutations=200, rounding=3)
{ # @author: Peter Carl, Brian Peterson (based on an idea by Pat Burns)
@@ -176,7 +174,6 @@
#' rpconstraint<-constraint(assets=10, min_mult=-Inf, max_mult=Inf, min_sum=.99, max_sum=1.01, min=.01, max=.4, weight_seq=generatesequence())
#' rp<- random_portfolios(rpconstraints=rpconstraint,permutations=1000)
#' head(rp)
-#' .
random_portfolios <- function (rpconstraints,permutations=100,...)
{ #
# this function generates a series of portfolios that are a "random walk" from the current portfolio
Modified: pkg/PortfolioAnalytics/R/trailingFUN.R
===================================================================
--- pkg/PortfolioAnalytics/R/trailingFUN.R 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/R/trailingFUN.R 2012-06-25 20:15:18 UTC (rev 2074)
@@ -15,13 +15,16 @@
#' this function is primarily designed for use with portfolio functions passing
#' 'x' or 'R' and weights, but may be usable for other things as well, see Exmample for a vector example.
#'
+#' called with e.g.
+#'
+#' trailingFUN(seq(1:100), weights=NULL, n=12, FUN='mean',FUNargs=list())
+#'
#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
#' @param weights a vector of weights to test
#' @param \dots any other passthru parameters
#' @param n numeric number of trailing periods
#' @param FUN string describing the function to be called
#' @param FUNargs list describing any additional arguments
-#' @example trailingFUN(seq(1:100), weights=NULL, n=12, FUN='mean',FUNargs=list())
#' @export
trailingFUN <- function(R, weights, n=0, FUN, FUNargs=NULL, ...) {
Modified: pkg/PortfolioAnalytics/man/CCCgarch.MM.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/CCCgarch.MM.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/CCCgarch.MM.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,11 +1,23 @@
\name{CCCgarch.MM}
\alias{CCCgarch.MM}
-\title{compute comoments for use by lower level optimization functions when the conditional covariance matrix is a CCC GARCH model...}
-\usage{CCCgarch.MM(R, momentargs, ...)}
-\description{compute comoments for use by lower level optimization functions when the conditional covariance matrix is a CCC GARCH model}
-\details{it first estimates the conditional GARCH variances, then filters out the
-time-varying volatility and estimates the higher order comoments on the innovations
-rescaled such that their unconditional covariance matrix is the conditional covariance matrix forecast}
-\arguments{\item{R}{an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns}
-\item{momentargs}{list containing arguments to be passed down to lower level functions, default NULL}
-\item{\dots}{any other passthru parameters}}
+\title{compute comoments for use by lower level optimization functions when the conditional covariance matrix is a CCC GARCH model}
+\usage{
+ CCCgarch.MM(R, momentargs = NULL, ...)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix, data frame, timeSeries
+ or zoo object of asset returns}
+
+ \item{momentargs}{list containing arguments to be passed
+ down to lower level functions, default NULL}
+
+ \item{\dots}{any other passthru parameters}
+}
+\description{
+ it first estimates the conditional GARCH variances, then
+ filters out the time-varying volatility and estimates the
+ higher order comoments on the innovations rescaled such
+ that their unconditional covariance matrix is the
+ conditional covariance matrix forecast
+}
+
Modified: pkg/PortfolioAnalytics/man/add.objective.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/add.objective.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/add.objective.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,20 +1,48 @@
\name{add.objective}
\alias{add.objective}
-\title{General interface for adding optimization objectives, including risk, return, and risk budget...}
-\usage{add.objective(constraints, type, name, arguments, enabled=FALSE, ...,
- indexnum)}
-\description{General interface for adding optimization objectives, including risk, return, and risk budget}
-\details{This function is the main function for adding and updating business objectives in an object of type \code{\link{constraint}}.
+\title{General interface for adding optimization objectives, including risk, return, and risk budget}
+\usage{
+ add.objective(constraints, type, name, arguments = NULL,
+ enabled = FALSE, ..., indexnum = NULL)
+}
+\arguments{
+ \item{constraints}{an object of type "constraints" to add
+ the objective to, specifying the constraints for the
+ optimization, see \code{\link{constraint}}}
-In general, you will define your objective as one of three types: 'return', 'risk', or 'risk_budget'.
-These have special handling and intelligent defaults for dealing with the function most likely to be
-used as objectives, including mean, median, VaR, ES, etc.}
-\author{Brian G. Peterson}
-\seealso{\code{\link{constraint}}}
-\arguments{\item{constraints}{an object of type "constraints" to add the objective to, specifying the constraints for the optimization, see \code{\link{constraint}}}
-\item{type}{character type of the objective to add or update, currently 'return','risk', or 'risk_budget'}
-\item{name}{name of the objective, should correspond to a function, though we will try to make allowances}
-\item{arguments}{default arguments to be passed to an objective function when executed}
-\item{enabled}{TRUE/FALSE}
-\item{\dots}{any other passthru parameters}
-\item{indexnum}{if you are updating a specific constraint, the index number in the $objectives list to update}}
+ \item{type}{character type of the objective to add or
+ update, currently 'return','risk', or 'risk_budget'}
+
+ \item{name}{name of the objective, should correspond to a
+ function, though we will try to make allowances}
+
+ \item{arguments}{default arguments to be passed to an
+ objective function when executed}
+
+ \item{enabled}{TRUE/FALSE}
+
+ \item{\dots}{any other passthru parameters}
+
+ \item{indexnum}{if you are updating a specific
+ constraint, the index number in the $objectives list to
+ update}
+}
+\description{
+ This function is the main function for adding and
+ updating business objectives in an object of type
+ \code{\link{constraint}}.
+}
+\details{
+ In general, you will define your objective as one of
+ three types: 'return', 'risk', or 'risk_budget'. These
+ have special handling and intelligent defaults for
+ dealing with the function most likely to be used as
+ objectives, including mean, median, VaR, ES, etc.
+}
+\author{
+ Brian G. Peterson
+}
+\seealso{
+ \code{\link{constraint}}
+}
+
Modified: pkg/PortfolioAnalytics/man/chart.Scatter.DE.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.Scatter.DE.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/chart.Scatter.DE.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,16 +1,44 @@
\name{chart.Scatter.DE}
\alias{chart.Scatter.DE}
-\title{classic risk return scatter of DEoptim results...}
-\usage{chart.Scatter.DE(DE, R, constraints, neighbors, return.col="mean",
- risk.col="ES", ..., element.color="darkgray", cex.axis=0.8)}
-\description{classic risk return scatter of DEoptim results}
-\seealso{\code{\link{optimize.portfolio}}}
-\arguments{\item{DE}{set of portfolios created by \code{\link{optimize.portfolio}}}
-\item{R}{an optional an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns, used to recalulate the objective function where required}
-\item{constraints}{an object of type "constraints" specifying the constraints for the optimization, see \code{\link{constraint}}}
-\item{neighbors}{set of 'neighbor' portfolios to overplot, see Details in \code{\link{charts.DE}}}
-\item{return.col}{string matching the objective of a 'return' objective, on vertical axis}
-\item{risk.col}{string matching the objective of a 'risk' objective, on horizontal axis}
-\item{...}{any other passthru parameters}
-\item{cex.axis}{The magnification to be used for axis annotation relative to the current setting of \code{cex}}
-\item{element.color}{color for the default plot scatter points}}
+\title{classic risk return scatter of DEoptim results}
+\usage{
+ chart.Scatter.DE(DE, R = NULL, constraints = NULL,
+ neighbors = NULL, return.col = "mean", risk.col = "ES",
+ ..., element.color = "darkgray", cex.axis = 0.8)
+}
+\arguments{
+ \item{DE}{set of portfolios created by
+ \code{\link{optimize.portfolio}}}
+
+ \item{R}{an optional an xts, vector, matrix, data frame,
+ timeSeries or zoo object of asset returns, used to
+ recalulate the objective function where required}
+
+ \item{constraints}{an object of type "constraints"
+ specifying the constraints for the optimization, see
+ \code{\link{constraint}}}
+
+ \item{neighbors}{set of 'neighbor' portfolios to
+ overplot, see Details in \code{\link{charts.DE}}}
+
+ \item{return.col}{string matching the objective of a
+ 'return' objective, on vertical axis}
+
+ \item{risk.col}{string matching the objective of a 'risk'
+ objective, on horizontal axis}
+
+ \item{...}{any other passthru parameters}
+
+ \item{cex.axis}{The magnification to be used for axis
+ annotation relative to the current setting of \code{cex}}
+
+ \item{element.color}{color for the default plot scatter
+ points}
+}
+\description{
+ classic risk return scatter of DEoptim results
+}
+\seealso{
+ \code{\link{optimize.portfolio}}
+}
+
Modified: pkg/PortfolioAnalytics/man/chart.Scatter.RP.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.Scatter.RP.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/chart.Scatter.RP.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,14 +1,36 @@
\name{chart.Scatter.RP}
\alias{chart.Scatter.RP}
-\title{classic risk return scatter of random portfolios...}
-\usage{chart.Scatter.RP(RP, neighbors, return.col="mean", risk.col="ES", ...,
- element.color="darkgray", cex.axis=0.8)}
-\description{classic risk return scatter of random portfolios}
-\seealso{\code{\link{optimize.portfolio}}}
-\arguments{\item{RP}{set of portfolios created by \code{\link{optimize.portfolio}}}
-\item{neighbors}{set of 'neighbor' portfolios to overplot, see Details}
-\item{return.col}{string matching the objective of a 'return' objective, on vertical axis}
-\item{risk.col}{string matching the objective of a 'risk' objective, on horizontal axis}
-\item{...}{any other passthru parameters}
-\item{cex.axis}{The magnification to be used for axis annotation relative to the current setting of \code{cex}}
-\item{element.color}{color for the default plot scatter points}}
+\title{classic risk return scatter of random portfolios}
+\usage{
+ chart.Scatter.RP(RP, neighbors = NULL,
+ return.col = "mean", risk.col = "ES", ...,
+ element.color = "darkgray", cex.axis = 0.8)
+}
+\arguments{
+ \item{RP}{set of portfolios created by
+ \code{\link{optimize.portfolio}}}
+
+ \item{neighbors}{set of 'neighbor' portfolios to
+ overplot, see Details}
+
+ \item{return.col}{string matching the objective of a
+ 'return' objective, on vertical axis}
+
+ \item{risk.col}{string matching the objective of a 'risk'
+ objective, on horizontal axis}
+
+ \item{...}{any other passthru parameters}
+
+ \item{cex.axis}{The magnification to be used for axis
+ annotation relative to the current setting of \code{cex}}
+
+ \item{element.color}{color for the default plot scatter
+ points}
+}
+\description{
+ classic risk return scatter of random portfolios
+}
+\seealso{
+ \code{\link{optimize.portfolio}}
+}
+
Modified: pkg/PortfolioAnalytics/man/chart.Weights.DE.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.Weights.DE.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/chart.Weights.DE.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,22 +1,45 @@
\name{chart.Weights.DE}
\alias{chart.Weights.DE}
-\title{boxplot of the weight distributions in the random portfolios...}
-\usage{chart.Weights.DE(DE, neighbors, ..., main="Weights", las=3, xlab,
- cex.lab=1, element.color="darkgray", cex.axis=0.8)}
-\description{boxplot of the weight distributions in the random portfolios}
-\seealso{\code{\link{optimize.portfolio}}}
-\arguments{\item{DE}{set of random portfolios created by \code{\link{optimize.portfolio}}}
-\item{neighbors}{set of 'neighbor' portfolios to overplot}
-\item{las}{numeric in \{0,1,2,3\}; the style of axis labels
-\describe{
-\item{0:}{always parallel to the axis [\emph{default}],}
-\item{1:}{always horizontal,}
-\item{2:}{always perpendicular to the axis,}
-\item{3:}{always vertical.}
-}}
-\item{xlab}{a title for the x axis: see \code{\link{title}}}
-\item{cex.lab}{The magnification to be used for x and y labels relative to the current setting of \code{cex}}
-\item{cex.axis}{The magnification to be used for axis annotation relative to the current setting of \code{cex}}
-\item{element.color}{color for the default plot lines}
-\item{...}{any other passthru parameters}
-\item{main}{an overall title for the plot: see \code{\link{title}}}}
+\title{boxplot of the weight distributions in the random portfolios}
+\usage{
+ chart.Weights.DE(DE, neighbors = NULL, ...,
+ main = "Weights", las = 3, xlab = NULL, cex.lab = 1,
+ element.color = "darkgray", cex.axis = 0.8)
+}
+\arguments{
+ \item{DE}{set of random portfolios created by
+ \code{\link{optimize.portfolio}}}
+
+ \item{neighbors}{set of 'neighbor' portfolios to
+ overplot}
+
+ \item{las}{numeric in \{0,1,2,3\}; the style of axis
+ labels \describe{ \item{0:}{always parallel to the axis
+ [\emph{default}],} \item{1:}{always horizontal,}
+ \item{2:}{always perpendicular to the axis,}
+ \item{3:}{always vertical.} }}
+
+ \item{xlab}{a title for the x axis: see
+ \code{\link{title}}}
+
+ \item{cex.lab}{The magnification to be used for x and y
+ labels relative to the current setting of \code{cex}}
+
+ \item{cex.axis}{The magnification to be used for axis
+ annotation relative to the current setting of \code{cex}}
+
+ \item{element.color}{color for the default plot lines}
+
+ \item{...}{any other passthru parameters}
+
+ \item{main}{an overall title for the plot: see
+ \code{\link{title}}}
+}
+\description{
+ boxplot of the weight distributions in the random
+ portfolios
+}
+\seealso{
+ \code{\link{optimize.portfolio}}
+}
+
Modified: pkg/PortfolioAnalytics/man/chart.Weights.RP.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.Weights.RP.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/chart.Weights.RP.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,22 +1,45 @@
\name{chart.Weights.RP}
\alias{chart.Weights.RP}
-\title{boxplot of the weight distributions in the random portfolios...}
-\usage{chart.Weights.RP(RP, neighbors, ..., main="Weights", las=3, xlab,
- cex.lab=1, element.color="darkgray", cex.axis=0.8)}
-\description{boxplot of the weight distributions in the random portfolios}
-\seealso{\code{\link{optimize.portfolio}}}
-\arguments{\item{RP}{set of random portfolios created by \code{\link{optimize.portfolio}}}
-\item{neighbors}{set of 'neighbor' portfolios to overplot}
-\item{las}{numeric in \{0,1,2,3\}; the style of axis labels
-\describe{
-\item{0:}{always parallel to the axis [\emph{default}],}
-\item{1:}{always horizontal,}
-\item{2:}{always perpendicular to the axis,}
-\item{3:}{always vertical.}
-}}
-\item{xlab}{a title for the x axis: see \code{\link{title}}}
-\item{cex.lab}{The magnification to be used for x and y labels relative to the current setting of \code{cex}}
-\item{cex.axis}{The magnification to be used for axis annotation relative to the current setting of \code{cex}}
-\item{element.color}{color for the default plot lines}
-\item{...}{any other passthru parameters}
-\item{main}{an overall title for the plot: see \code{\link{title}}}}
+\title{boxplot of the weight distributions in the random portfolios}
+\usage{
+ chart.Weights.RP(RP, neighbors = NULL, ...,
+ main = "Weights", las = 3, xlab = NULL, cex.lab = 1,
+ element.color = "darkgray", cex.axis = 0.8)
+}
+\arguments{
+ \item{RP}{set of random portfolios created by
+ \code{\link{optimize.portfolio}}}
+
+ \item{neighbors}{set of 'neighbor' portfolios to
+ overplot}
+
+ \item{las}{numeric in \{0,1,2,3\}; the style of axis
+ labels \describe{ \item{0:}{always parallel to the axis
+ [\emph{default}],} \item{1:}{always horizontal,}
+ \item{2:}{always perpendicular to the axis,}
+ \item{3:}{always vertical.} }}
+
+ \item{xlab}{a title for the x axis: see
+ \code{\link{title}}}
+
+ \item{cex.lab}{The magnification to be used for x and y
+ labels relative to the current setting of \code{cex}}
+
+ \item{cex.axis}{The magnification to be used for axis
+ annotation relative to the current setting of \code{cex}}
+
+ \item{element.color}{color for the default plot lines}
+
+ \item{...}{any other passthru parameters}
+
+ \item{main}{an overall title for the plot: see
+ \code{\link{title}}}
+}
+\description{
+ boxplot of the weight distributions in the random
+ portfolios
+}
+\seealso{
+ \code{\link{optimize.portfolio}}
+}
+
Modified: pkg/PortfolioAnalytics/man/charts.DE.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/charts.DE.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/charts.DE.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,22 +1,43 @@
\name{charts.DE}
\alias{charts.DE}
-\title{scatter and weights chart for random portfolios...}
-\usage{charts.DE(DE, risk.col, return.col, neighbors,
- main="DEoptim.Portfolios", ...)}
-\description{scatter and weights chart for random portfolios}
-\details{\code{neighbors} may be specified in three ways.
-The first is as a single number of neighbors. This will extract the \code{neighbors} closest
-portfolios in terms of the \code{out} numerical statistic.
-The second method consists of a numeric vector for \code{neighbors}.
-This will extract the \code{neighbors} with portfolio index numbers that correspond to the vector contents.
-The third method for specifying \code{neighbors} is to pass in a matrix.
-This matrix should look like the output of \code{\link{extractStats}}, and should contain
-\code{risk.col},\code{return.col}, and weights columns all properly named.}
-\seealso{\code{\link{optimize.portfolio}}
-\code{\link{extractStats}}}
-\arguments{\item{DE}{set of random portfolios created by \code{\link{optimize.portfolio}}}
-\item{...}{any other passthru parameters}
-\item{risk.col}{string name of column to use for risk (horizontal axis)}
-\item{return.col}{string name of column to use for returns (vertical axis)}
-\item{neighbors}{set of 'neighbor portfolios to overplot}
-\item{main}{an overall title for the plot: see \code{\link{title}}}}
+\title{scatter and weights chart for random portfolios}
+\usage{
+ charts.DE(DE, risk.col, return.col, neighbors = NULL,
+ main = "DEoptim.Portfolios", ...)
+}
+\arguments{
+ \item{DE}{set of random portfolios created by
+ \code{\link{optimize.portfolio}}}
+
+ \item{...}{any other passthru parameters}
+
+ \item{risk.col}{string name of column to use for risk
+ (horizontal axis)}
+
+ \item{return.col}{string name of column to use for
+ returns (vertical axis)}
+
+ \item{neighbors}{set of 'neighbor portfolios to overplot}
+
+ \item{main}{an overall title for the plot: see
+ \code{\link{title}}}
+}
+\description{
+ \code{neighbors} may be specified in three ways. The
+ first is as a single number of neighbors. This will
+ extract the \code{neighbors} closest portfolios in terms
+ of the \code{out} numerical statistic. The second method
+ consists of a numeric vector for \code{neighbors}. This
+ will extract the \code{neighbors} with portfolio index
+ numbers that correspond to the vector contents. The third
+ method for specifying \code{neighbors} is to pass in a
+ matrix. This matrix should look like the output of
+ \code{\link{extractStats}}, and should contain
+ \code{risk.col},\code{return.col}, and weights columns
+ all properly named.
+}
+\seealso{
+ \code{\link{optimize.portfolio}}
+ \code{\link{extractStats}}
+}
+
Modified: pkg/PortfolioAnalytics/man/charts.RP.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/charts.RP.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/charts.RP.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,22 +1,43 @@
\name{charts.RP}
\alias{charts.RP}
-\title{scatter and weights chart for random portfolios...}
-\usage{charts.RP(RP, risk.col, return.col, neighbors,
- main="Random.Portfolios", ...)}
-\description{scatter and weights chart for random portfolios}
-\details{\code{neighbors} may be specified in three ways.
-The first is as a single number of neighbors. This will extract the \code{neighbors} closest
-portfolios in terms of the \code{out} numerical statistic.
-The second method consists of a numeric vector for \code{neighbors}.
-This will extract the \code{neighbors} with portfolio index numbers that correspond to the vector contents.
-The third method for specifying \code{neighbors} is to pass in a matrix.
-This matrix should look like the output of \code{\link{extractStats}}, and should contain
-\code{risk.col},\code{return.col}, and weights columns all properly named.}
-\seealso{\code{\link{optimize.portfolio}}
-\code{\link{extractStats}}}
-\arguments{\item{RP}{set of random portfolios created by \code{\link{optimize.portfolio}}}
-\item{...}{any other passthru parameters}
-\item{risk.col}{string name of column to use for risk (horizontal axis)}
-\item{return.col}{string name of column to use for returns (vertical axis)}
-\item{neighbors}{set of 'neighbor portfolios to overplot}
-\item{main}{an overall title for the plot: see \code{\link{title}}}}
+\title{scatter and weights chart for random portfolios}
+\usage{
+ charts.RP(RP, risk.col, return.col, neighbors = NULL,
+ main = "Random.Portfolios", ...)
+}
+\arguments{
+ \item{RP}{set of random portfolios created by
+ \code{\link{optimize.portfolio}}}
+
+ \item{...}{any other passthru parameters}
+
+ \item{risk.col}{string name of column to use for risk
+ (horizontal axis)}
+
+ \item{return.col}{string name of column to use for
+ returns (vertical axis)}
+
+ \item{neighbors}{set of 'neighbor portfolios to overplot}
+
+ \item{main}{an overall title for the plot: see
+ \code{\link{title}}}
+}
+\description{
+ \code{neighbors} may be specified in three ways. The
+ first is as a single number of neighbors. This will
+ extract the \code{neighbors} closest portfolios in terms
+ of the \code{out} numerical statistic. The second method
+ consists of a numeric vector for \code{neighbors}. This
+ will extract the \code{neighbors} with portfolio index
+ numbers that correspond to the vector contents. The third
+ method for specifying \code{neighbors} is to pass in a
+ matrix. This matrix should look like the output of
+ \code{\link{extractStats}}, and should contain
+ \code{risk.col},\code{return.col}, and weights columns
+ all properly named.
+}
+\seealso{
+ \code{\link{optimize.portfolio}}
+ \code{\link{extractStats}}
+}
+
Modified: pkg/PortfolioAnalytics/man/constrained_objective.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/constrained_objective.Rd 2012-06-25 18:45:23 UTC (rev 2073)
+++ pkg/PortfolioAnalytics/man/constrained_objective.Rd 2012-06-25 20:15:18 UTC (rev 2074)
@@ -1,48 +1,93 @@
\name{constrained_objective}
\alias{constrained_objective}
-\title{function to calculate a numeric return value for a portfolio based on a set of constraints...}
-\usage{constrained_objective(w, R, constraints, ..., trace=FALSE,
- normalize=TRUE, storage=FALSE)}
-\description{function to calculate a numeric return value for a portfolio based on a set of constraints}
-\details{function to calculate a numeric return value for a portfolio based on a set of constraints,
-we'll try to make as few assumptions as possible, and only run objectives that are required by the user
+\title{function to calculate a numeric return value for a portfolio based on a set of constraints}
+\usage{
+ constrained_objective(w, R, constraints, ...,
+ trace = FALSE, normalize = TRUE, storage = FALSE)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix, data frame, timeSeries
+ or zoo object of asset returns}
-If the user has passed in either min_sum or max_sum constraints for the portfolio, or both,
-and are using a numerical optimization method like DEoptim, and normalize=TRUE, the default,
-we'll normalize the weights passed in to whichever boundary condition has been violated.
-If using random portfolios, all the portfolios generated will meet the constraints by construction.
-NOTE: this means that the weights produced by a numeric optimization algorithm like DEoptim
-might violate your constraints, so you'd need to renormalize them after optimizing
-We apply the same normalization in \code{\link{optimize.portfolio}} so that the weights you see have been
-normalized to min_sum if the generated portfolio is smaller than min_sum or max_sum if the
-generated portfolio is larger than max_sum.
-This normalization increases the speed of optimization and convergence by several orders of magnitude in many cases.
+ \item{w}{a vector of weights to test}
-You may find that for some portfolios, normalization is not desirable, if the algorithm
-cannot find a direction in which to move to head towards an optimal portfolio. In these cases,
-it may be best to set normalize=FALSE, and penalize the portfolios if the sum of the weighting
-vector lies outside the min_sum and/or max_sum.
+ \item{constraints}{an object of type "constraints"
+ specifying the constraints for the optimization, see
+ \code{\link{constraint}}}
-Whether or not we normalize the weights using min_sum and max_sum, and are using a numerical optimization
-engine like DEoptim, we will penalize portfolios that violate weight constraints in much the same way
-we penalize other constraints. If a min_sum/max_sum normalization has not occurred, convergence
-can take a very long time. We currently do not allow for a non-normalized full investment constraint.
-Future version of this function could include this additional constraint penalty.
+ \item{\dots}{any other passthru parameters}
-When you are optimizing a return objective, you must specify a negative multiplier
-for the return objective so that the function will maximize return. If you specify a target return,
-any return less than your target will be penalized. If you do not specify a target return,
-you may need to specify a negative VTR (value to reach) , or the function will not converge.
-Try the maximum expected return times the multiplier (e.g. -1 or -10).
-Adding a return objective defaults the multiplier to -1.
+ \item{trace}{TRUE/FALSE whether to include debugging and
+ additional detail in the output list}
-Additional parameters for random portfolios or \code{\link[DEoptim]{DEoptim.control}} may be passed in via \dots}
-\seealso{\code{\link{constraint}}, \code{\link{objective}}, \code{\link[DEoptim]{DEoptim.control}}}
-\author{Kris Boudt, Peter Carl, Brian G. Peterson}
-\arguments{\item{R}{an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns}
-\item{w}{a vector of weights to test}
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/returnanalytics -r 2074
More information about the Returnanalytics-commits
mailing list