[Returnanalytics-commits] r2334 - in pkg/PerformanceAnalytics: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 1 18:57:25 CEST 2013


Author: braverock
Date: 2013-04-01 18:57:25 +0200 (Mon, 01 Apr 2013)
New Revision: 2334

Modified:
   pkg/PerformanceAnalytics/R/ActivePremium.R
   pkg/PerformanceAnalytics/R/CAPM.alpha.R
   pkg/PerformanceAnalytics/R/CAPM.beta.R
   pkg/PerformanceAnalytics/R/table.CAPM.R
   pkg/PerformanceAnalytics/man/ActivePremium.Rd
   pkg/PerformanceAnalytics/man/CAPM.alpha.Rd
   pkg/PerformanceAnalytics/man/CAPM.beta.Rd
   pkg/PerformanceAnalytics/man/table.CAPM.Rd
Log:
- add SFM aliases to CAPM fns, thanks to Doug Martin for the suggestion
- update docs


Modified: pkg/PerformanceAnalytics/R/ActivePremium.R
===================================================================
--- pkg/PerformanceAnalytics/R/ActivePremium.R	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/R/ActivePremium.R	2013-04-01 16:57:25 UTC (rev 2334)
@@ -1,4 +1,4 @@
-#' Active Premium
+#' Active Premium or Active Return
 #' 
 #' The return on an investment's annualized return minus the benchmark's
 #' annualized return.
@@ -6,6 +6,7 @@
 #' Active Premium = Investment's annualized return - Benchmark's annualized
 #' return
 #' 
+#' Also commonly referred to as 'active return'.
 #' 
 #' @param Ra return vector of the portfolio
 #' @param Rb return vector of the benchmark asset
@@ -24,12 +25,10 @@
 #'     ActivePremium(managers[,1,drop=FALSE], managers[,8,drop=FALSE]) 
 #'     ActivePremium(managers[,1:6], managers[,8,drop=FALSE]) 
 #'     ActivePremium(managers[,1:6], managers[,8:7,drop=FALSE])
-#' 
-#' @export
-#' 
-#' 
-
-ActivePremium <- function (Ra, Rb, scale = NA)
+#' @rdname ActivePremium
+#' @aliases ActivePremium, ActiveReturn
+#' @export 
+ActiveReturn <- ActivePremium <- function (Ra, Rb, scale = NA)
 { # @author Peter Carl
 
     # FUNCTION

Modified: pkg/PerformanceAnalytics/R/CAPM.alpha.R
===================================================================
--- pkg/PerformanceAnalytics/R/CAPM.alpha.R	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/R/CAPM.alpha.R	2013-04-01 16:57:25 UTC (rev 2334)
@@ -6,7 +6,10 @@
 #' portion of the managers returns that are not attributable to "Beta", or the
 #' portion of performance attributable to a benchmark.
 #' 
-#' 
+#' While the classical CAPM has been almost completely discredited by the 
+#' literature, it is an example of a simple single factor model, 
+#' comparing an asset to any arbitrary benchmark.
+#'  
 #' @param Ra an xts, vector, matrix, data frame, timeSeries or zoo object of
 #' asset returns
 #' @param Rb return vector of the benchmark asset

Modified: pkg/PerformanceAnalytics/R/CAPM.beta.R
===================================================================
--- pkg/PerformanceAnalytics/R/CAPM.beta.R	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/R/CAPM.beta.R	2013-04-01 16:57:25 UTC (rev 2334)
@@ -21,12 +21,16 @@
 #' Alternatively, \code{CAPM.beta.bear} provides the calculation on negative
 #' market returns.
 #' 
-#' The \code{TimingRatio} can help assess whether the manager is a good timer
+#' The \code{TimingRatio} may help assess whether the manager is a good timer
 #' of asset allocation decisions.  The ratio, which is calculated as
 #' \deqn{TimingRatio =\frac{\beta^{+}}{\beta^{-}}}{Timing Ratio = beta+/beta-}
 #' is best when greater than one in a rising market and less than one in a
 #' falling market.
 #' 
+#' While the classical CAPM has been almost completely discredited by the 
+#' literature, it is an example of a simple single factor model, 
+#' comparing an asset to any arbitrary benchmark.
+#'  
 #' @aliases CAPM.beta CAPM.beta.bull CAPM.beta.bear TimingRatio
 #' @param Ra an xts, vector, matrix, data frame, timeSeries or zoo object of
 #' asset returns

Modified: pkg/PerformanceAnalytics/R/table.CAPM.R
===================================================================
--- pkg/PerformanceAnalytics/R/table.CAPM.R	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/R/table.CAPM.R	2013-04-01 16:57:25 UTC (rev 2334)
@@ -1,7 +1,7 @@
-#' Asset-Pricing Model Summary: Statistics and Stylized Facts
+#' Single Factor Asset-Pricing Model Summary: Statistics and Stylized Facts
 #' 
-#' Takes a set of returns and relates them to a market benchmark. Provides a
-#' set of measures related to the excess return single index model, or CAPM.
+#' Takes a set of returns and relates them to a benchmark return. Provides a
+#' set of measures related to an excess return single factor model, or CAPM.
 #' 
 #' This table will show statistics pertaining to an asset against a set of
 #' benchmarks, or statistics for a set of assets against a benchmark.
@@ -21,24 +21,18 @@
 #' @examples
 #' 
 #' data(managers)
-#' table.CAPM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
+#' table.SFM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
 #' 
-#' result = table.CAPM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
+#' result = table.SFM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
 #' textplot(result, rmar = 0.8, cmar = 1.5,  max.cex=.9, halign = "center", valign = "top", row.valign="center", wrap.rownames=15, wrap.colnames=10, mar = c(0,0,3,0)+0.1)
-#' title(main="CAPM-Related Statistics")
+#' title(main="Single Factor Model Related Statistics")
 #' 
-#' 
+#' @rdname table.CAPM
+#' @aliases table.CAPM, table.SFM
 #' @export
-table.CAPM <- function (Ra, Rb, scale = NA, Rf = 0, digits = 4)
+table.SFM <- table.CAPM <- function (Ra, Rb, scale = NA, Rf = 0, digits = 4)
 {# @author Peter Carl
 
-    # DESCRIPTION:
-    # Asset-Pricing Model Summary: Statistics and Stylized Facts
-    #
-    # Takes a set of returns and relates them to a market benchmark.
-    # Provides a set of measures related to the excess return single index
-    # model, or CAPM.
-
     # Inputs:
     # Ra: a vector of returns to test, e.g., the asset to be examined
     # Rb: a matrix, data.frame, or timeSeries of benchmarks to test the asset

Modified: pkg/PerformanceAnalytics/man/ActivePremium.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/ActivePremium.Rd	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/man/ActivePremium.Rd	2013-04-01 16:57:25 UTC (rev 2334)
@@ -1,8 +1,9 @@
-\name{ActivePremium}
-\alias{ActivePremium}
-\title{Active Premium}
+\name{ActiveReturn}
+\alias{ActivePremium,}
+\alias{ActiveReturn}
+\title{Active Premium or Active Return}
 \usage{
-  ActivePremium(Ra, Rb, scale = NA)
+  ActiveReturn(Ra, Rb, scale = NA)
 }
 \arguments{
   \item{Ra}{return vector of the portfolio}
@@ -19,6 +20,8 @@
 \details{
   Active Premium = Investment's annualized return -
   Benchmark's annualized return
+
+  Also commonly referred to as 'active return'.
 }
 \examples{
 data(managers)

Modified: pkg/PerformanceAnalytics/man/CAPM.alpha.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/CAPM.alpha.Rd	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/man/CAPM.alpha.Rd	2013-04-01 16:57:25 UTC (rev 2334)
@@ -20,6 +20,11 @@
   measuring the portion of the managers returns that are
   not attributable to "Beta", or the portion of performance
   attributable to a benchmark.
+
+  While the classical CAPM has been almost completely
+  discredited by the literature, it is an example of a
+  simple single factor model, comparing an asset to any
+  arbitrary benchmark.
 }
 \examples{
 # First we load the data

Modified: pkg/PerformanceAnalytics/man/CAPM.beta.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/CAPM.beta.Rd	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/man/CAPM.beta.Rd	2013-04-01 16:57:25 UTC (rev 2334)
@@ -48,12 +48,17 @@
   markets. Alternatively, \code{CAPM.beta.bear} provides
   the calculation on negative market returns.
 
-  The \code{TimingRatio} can help assess whether the
+  The \code{TimingRatio} may help assess whether the
   manager is a good timer of asset allocation decisions.
   The ratio, which is calculated as \deqn{TimingRatio
   =\frac{\beta^{+}}{\beta^{-}}}{Timing Ratio = beta+/beta-}
   is best when greater than one in a rising market and less
   than one in a falling market.
+
+  While the classical CAPM has been almost completely
+  discredited by the literature, it is an example of a
+  simple single factor model, comparing an asset to any
+  arbitrary benchmark.
 }
 \examples{
 data(managers)

Modified: pkg/PerformanceAnalytics/man/table.CAPM.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/table.CAPM.Rd	2013-04-01 16:17:43 UTC (rev 2333)
+++ pkg/PerformanceAnalytics/man/table.CAPM.Rd	2013-04-01 16:57:25 UTC (rev 2334)
@@ -1,8 +1,9 @@
-\name{table.CAPM}
-\alias{table.CAPM}
-\title{Asset-Pricing Model Summary: Statistics and Stylized Facts}
+\name{table.SFM}
+\alias{table.CAPM,}
+\alias{table.SFM}
+\title{Single Factor Asset-Pricing Model Summary: Statistics and Stylized Facts}
 \usage{
-  table.CAPM(Ra, Rb, scale = NA, Rf = 0, digits = 4)
+  table.SFM(Ra, Rb, scale = NA, Rf = 0, digits = 4)
 }
 \arguments{
   \item{Ra}{a vector of returns to test, e.g., the asset to
@@ -19,9 +20,9 @@
   \item{digits}{number of digits to round results to}
 }
 \description{
-  Takes a set of returns and relates them to a market
-  benchmark. Provides a set of measures related to the
-  excess return single index model, or CAPM.
+  Takes a set of returns and relates them to a benchmark
+  return. Provides a set of measures related to an excess
+  return single factor model, or CAPM.
 }
 \details{
   This table will show statistics pertaining to an asset
@@ -30,11 +31,11 @@
 }
 \examples{
 data(managers)
-table.CAPM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
+table.SFM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
 
-result = table.CAPM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
+result = table.SFM(managers[,1:3,drop=FALSE], managers[,8,drop=FALSE], Rf = managers[,10,drop=FALSE])
 textplot(result, rmar = 0.8, cmar = 1.5,  max.cex=.9, halign = "center", valign = "top", row.valign="center", wrap.rownames=15, wrap.colnames=10, mar = c(0,0,3,0)+0.1)
-title(main="CAPM-Related Statistics")
+title(main="Single Factor Model Related Statistics")
 }
 \author{
   Peter Carl



More information about the Returnanalytics-commits mailing list