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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 23 01:44:43 CEST 2013


Author: rossbennett34
Date: 2013-07-23 01:44:43 +0200 (Tue, 23 Jul 2013)
New Revision: 2624

Added:
   pkg/PortfolioAnalytics/man/add.objective_v1.Rd
Modified:
   pkg/PortfolioAnalytics/NAMESPACE
   pkg/PortfolioAnalytics/R/objective.R
   pkg/PortfolioAnalytics/man/add.objective.Rd
Log:
alias add.objective_v2 to add.objective and add _v1 to old add.objective

Modified: pkg/PortfolioAnalytics/NAMESPACE
===================================================================
--- pkg/PortfolioAnalytics/NAMESPACE	2013-07-22 23:39:15 UTC (rev 2623)
+++ pkg/PortfolioAnalytics/NAMESPACE	2013-07-22 23:44:43 UTC (rev 2624)
@@ -1,6 +1,6 @@
 export(add.constraint)
+export(add.objective_v1)
 export(add.objective_v2)
-export(add.objective)
 export(box_constraint)
 export(CCCgarch.MM)
 export(chart.Scatter.DE)

Modified: pkg/PortfolioAnalytics/R/objective.R
===================================================================
--- pkg/PortfolioAnalytics/R/objective.R	2013-07-22 23:39:15 UTC (rev 2623)
+++ pkg/PortfolioAnalytics/R/objective.R	2013-07-22 23:44:43 UTC (rev 2624)
@@ -69,7 +69,7 @@
 #' @seealso \code{\link{constraint}}
 #' 
 #' @export
-add.objective <- function(constraints, type, name, arguments=NULL, enabled=TRUE, ..., indexnum=NULL)
+add.objective_v1 <- function(constraints, type, name, arguments=NULL, enabled=TRUE, ..., indexnum=NULL)
 {
     if (!is.constraint(constraints)) {stop("constraints passed in are not of class constraint")}
 
@@ -146,7 +146,8 @@
 #' @param \dots any other passthru parameters 
 #' @param indexnum if you are updating a specific constraint, the index number in the $objectives list to update
 #' @author Brian G. Peterson and Ross Bennett
-#' 
+#' @aliases add.objective
+#' @rdname add.objective
 #' @seealso \code{\link{objective}}
 #' 
 #' @export
@@ -214,6 +215,9 @@
   return(portfolio)
 }
 
+# Alias add.objective_v2 to add.objective
+add.objective <- add.objective_v2
+
 # update.objective <- function(object, ...) {
 #   # here we do a bunch of magic to update the correct index'd objective
 # 

Modified: pkg/PortfolioAnalytics/man/add.objective.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/add.objective.Rd	2013-07-22 23:39:15 UTC (rev 2623)
+++ pkg/PortfolioAnalytics/man/add.objective.Rd	2013-07-22 23:44:43 UTC (rev 2624)
@@ -1,14 +1,15 @@
-\name{add.objective}
+\name{add.objective_v2}
 \alias{add.objective}
+\alias{add.objective_v2}
 \title{General interface for adding optimization objectives, including risk, return, and risk budget}
 \usage{
-  add.objective(constraints, type, name, arguments = NULL,
+  add.objective_v2(portfolio, type, name, arguments = NULL,
     enabled = TRUE, ..., 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}}}
+  \item{portfolio}{an object of type 'portfolio' to add the
+  objective to, specifying the portfolio for the
+  optimization, see \code{\link{portfolio}}}
 
   \item{type}{character type of the objective to add or
   update, currently 'return','risk', or 'risk_budget'}
@@ -30,7 +31,7 @@
 \description{
   This function is the main function for adding and
   updating business objectives in an object of type
-  \code{\link{constraint}}.
+  \code{\link{portfolio}}.
 }
 \details{
   In general, you will define your objective as one of
@@ -40,9 +41,9 @@
   objectives, including mean, median, VaR, ES, etc.
 }
 \author{
-  Brian G. Peterson
+  Brian G. Peterson and Ross Bennett
 }
 \seealso{
-  \code{\link{constraint}}
+  \code{\link{objective}}
 }
 

Added: pkg/PortfolioAnalytics/man/add.objective_v1.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/add.objective_v1.Rd	                        (rev 0)
+++ pkg/PortfolioAnalytics/man/add.objective_v1.Rd	2013-07-22 23:44:43 UTC (rev 2624)
@@ -0,0 +1,48 @@
+\name{add.objective_v1}
+\alias{add.objective_v1}
+\title{General interface for adding optimization objectives, including risk, return, and risk budget}
+\usage{
+  add.objective_v1(constraints, type, name,
+    arguments = NULL, enabled = TRUE, ..., 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}}}
+
+  \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}}
+}
+



More information about the Returnanalytics-commits mailing list