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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 10 11:10:36 CEST 2012


Author: matthieu_lestel
Date: 2012-08-10 11:10:36 +0200 (Fri, 10 Aug 2012)
New Revision: 2230

Modified:
   pkg/PerformanceAnalytics/R/DownsideDeviation.R
   pkg/PerformanceAnalytics/R/TreynorRatio.R
   pkg/PerformanceAnalytics/R/UpsideRisk.R
   pkg/PerformanceAnalytics/R/VaR.R
   pkg/PerformanceAnalytics/R/chart.RollingRegression.R
   pkg/PerformanceAnalytics/R/chart.TimeSeries.R
   pkg/PerformanceAnalytics/R/mean.utils.R
   pkg/PerformanceAnalytics/R/textplot.R
   pkg/PerformanceAnalytics/man/PerformanceAnalytics-package.Rd
   pkg/PerformanceAnalytics/man/TreynorRatio.Rd
   pkg/PerformanceAnalytics/man/VaR.Rd
   pkg/PerformanceAnalytics/man/chart.RollingRegression.Rd
   pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd
   pkg/PerformanceAnalytics/man/mean.geometric.Rd
   pkg/PerformanceAnalytics/man/textplot.Rd
Log:
no more warnings in R CMD check

Modified: pkg/PerformanceAnalytics/R/DownsideDeviation.R
===================================================================
--- pkg/PerformanceAnalytics/R/DownsideDeviation.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/DownsideDeviation.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -144,7 +144,6 @@
         return(result)
     }
     else {
-        print("doit être format avec date")
         R = checkData(R)
         result = apply(R, MARGIN = 2, DownsideDeviation, MAR = MAR, method = method)
         result<-t(result)
@@ -181,4 +180,4 @@
         rownames(result) = paste("Downside Potential (MAR = ", round(mean(MAR),1),"%)", sep="")
         return(result)
     }
-}
\ No newline at end of file
+}

Modified: pkg/PerformanceAnalytics/R/TreynorRatio.R
===================================================================
--- pkg/PerformanceAnalytics/R/TreynorRatio.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/TreynorRatio.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -152,62 +152,3 @@
      }
 }
 
-#' @rdname TreynorRatio
-ModifiedTreynorRatio <-
-		function (Ra, Rb, Rf = 0, scale = NA)
-{
-	if(is.na(scale)) {
-		freq = periodicity(Ra)
-		switch(freq$scale,
-				minute = {stop("Data periodicity too high")},
-				hourly = {stop("Data periodicity too high")},
-				daily = {scale = 252},
-				weekly = {scale = 52},
-				monthly = {scale = 12},
-				quarterly = {scale = 4},
-				yearly = {scale = 1}
-		)
-	}
-	
-	calcul = FALSE
-	Ra = checkData(Ra, method="matrix")
-	Rb = checkData(Rb, method="matrix")
-	
-	if (ncol(Ra)==1 || is.null(Ra) || is.vector(Ra)) {
-		
-		Rp = (prod(1+Ra/100)^(scale/length(R))-1)*100
-		for (i in (1:length(Ra))) {
-			if (!is.na(Ra[i])) {
-				calcul = TRUE
-			}
-		}
-		if (calcul) {
-			result = (Rp - Rf) / SystematicRisk(Ra, Rb, Rf)
-		}    
-		else {
-			result = NA
-		}
-		return(result)
-	}
-	else {
-		Ra = checkData(Ra)
-		result = apply(Ra, MARGIN = 2, ModifiedTreynorRatio, Rb = Rb, Rf = Rf)
-		result<-t(result)
-		colnames(result) = colnames(Ra)
-		rownames(result) = paste("Modified Treynor Ratio (Risk free = ",Rf,")", sep="")
-		return(result)
-	}
-}
-
-
-###############################################################################
-# R (http://r-project.org/) Econometrics for Performance and Risk Analysis
-#
-# Copyright (c) 2004-2012 Peter Carl and Brian G. Peterson
-#
-# This R package is distributed under the terms of the GNU Public License (GPL)
-# for full details see the file COPYING
-#
-# $Id$
-#
-###############################################################################

Modified: pkg/PerformanceAnalytics/R/UpsideRisk.R
===================================================================
--- pkg/PerformanceAnalytics/R/UpsideRisk.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/UpsideRisk.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -94,15 +94,3 @@
         return(result)
     }
 }
-
-###############################################################################
-# R (http://r-project.org/) Econometrics for Performance and Risk Analysis
-#
-# Copyright (c) 2004-2012 Peter Carl and Brian G. Peterson
-#
-# This R package is distributed under the terms of the GNU Public License (GPL)
-# for full details see the file COPYING
-#
-# $Id: UpsideRisk.R 1989 2012-06-06 18:18:50Z matthieu_lestel $
-#
-###############################################################################

Modified: pkg/PerformanceAnalytics/R/VaR.R
===================================================================
--- pkg/PerformanceAnalytics/R/VaR.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/VaR.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -65,9 +65,8 @@
 #' decomposition is possible in a financially meaningful way.
 #' @author Brian G. Peterson and Kris Boudt
 #' @seealso \code{\link{SharpeRatio.modified}} \cr
-#' \code{\link{chart.VaRSensitivity}} \cr % \code{\link[VaR]{VaR.gpd}} \cr %
-#' \code{\link[VaR]{VaR.norm}} \cr % \code{\link[VaR]{VaR.backtest}} \cr
-#' \code{\link{Return.clean}} \cr
+#' \code{\link{chart.VaRSensitivity}} \cr
+#' \code{\link{Return.clean}} 
 #' @references Boudt, Kris, Peterson, Brian, and Christophe Croux. 2008.
 #' Estimation and decomposition of downside risk for portfolios with non-normal
 #' returns. 2008. The Journal of Risk, vol. 11, 79-103.

Modified: pkg/PerformanceAnalytics/R/chart.RollingRegression.R
===================================================================
--- pkg/PerformanceAnalytics/R/chart.RollingRegression.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/chart.RollingRegression.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -28,6 +28,9 @@
 #' @param na.pad TRUE/FALSE If TRUE it adds any times that would not otherwise
 #' have been in the result with a value of NA. If FALSE those times are
 #' dropped.
+#' @param legend.loc used to set the position of the legend
+#' @param event.labels 	if not null and event.lines is not null, this will apply a 
+#' list of text labels to the vertical lines drawn
 #' @param \dots any other passthru parameters to \code{\link{chart.TimeSeries}}
 #' @note Most inputs are the same as "\code{\link{plot}}" and are principally
 #' included so that some sensible defaults could be set.

Modified: pkg/PerformanceAnalytics/R/chart.TimeSeries.R
===================================================================
--- pkg/PerformanceAnalytics/R/chart.TimeSeries.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/chart.TimeSeries.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -67,6 +67,7 @@
 #' @param minor.ticks Should minor tickmarks be drawn, default TRUE
 #' @param xaxis.labels Allows for non-date labeling of date axes, default is
 #' NULL
+#' @param space default 0
 #' @param \dots any other passthru parameters
 #' @author Peter Carl
 #' @seealso \code{\link{plot}}, \code{\link{par}},

Modified: pkg/PerformanceAnalytics/R/mean.utils.R
===================================================================
--- pkg/PerformanceAnalytics/R/mean.utils.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/mean.utils.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -30,6 +30,7 @@
 #' mean.UCL(edhec[,"Funds of Funds"])
 #' mean.LCL(edhec[,"Funds of Funds"])
 #' @rdname mean.geometric
+#' @method mean geometric
 #' @export
 mean.geometric <-
 function (x, ...)
@@ -61,6 +62,7 @@
 }
 
 #' @rdname mean.geometric
+#' @method mean stderr
 #' @export
 mean.stderr <-
 function (x, ...)
@@ -92,6 +94,7 @@
 }
 
 #' @rdname mean.geometric
+#' @method mean LCL
 #' @export
 mean.LCL <-
 function (x, ci = 0.95, ...)
@@ -130,6 +133,7 @@
 }
 
 #' @rdname mean.geometric
+#' @method mean UCL
 #' @export
 mean.UCL <-
 function (x, ci = 0.95, ...)

Modified: pkg/PerformanceAnalytics/R/textplot.R
===================================================================
--- pkg/PerformanceAnalytics/R/textplot.R	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/R/textplot.R	2012-08-10 09:10:36 UTC (rev 2230)
@@ -67,6 +67,10 @@
 #' tabs with
 #' @param \dots Optional arguments passed to the text plotting command or
 #' specialized object methods
+#' @param fixed.width default is TRUE
+#' @param cspace default is 1
+#' @param lspace default is 1
+#' @param tab.width default is 8
 #' @author Originally written by Gregory R. Warnes
 #' \email{warnes@@bst.rochester.edu} for the package 'gplots', modified by
 #' Peter Carl
@@ -107,6 +111,8 @@
 
 
 #' @rdname textplot
+#' @method textplot default
+#' @export
 textplot.default <- function(object,
                              halign=c("center","left","right"),
                              valign=c("center","top","bottom"),
@@ -136,6 +142,8 @@
 
 
 #' @rdname textplot
+#' @method textplot data.frame
+#' @export
 textplot.data.frame <- function(object,
                              halign=c("center","left","right"),
                              valign=c("center","top","bottom"),
@@ -168,6 +176,8 @@
 }
 
 #' @rdname textplot
+#' @method textplot matrix
+#' @export
 textplot.matrix <- function(object,
                             halign=c("center","left","right"),
                             valign=c("center","top","bottom"),
@@ -373,6 +383,8 @@
 }
 
 #' @rdname textplot
+#' @method textplot character
+#' @export
 textplot.character <- function (object,
                                 halign = c("center", "left", "right"),
                                 valign = c("center", "top", "bottom"),

Modified: pkg/PerformanceAnalytics/man/PerformanceAnalytics-package.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/PerformanceAnalytics-package.Rd	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/man/PerformanceAnalytics-package.Rd	2012-08-10 09:10:36 UTC (rev 2230)
@@ -106,7 +106,7 @@
 \emph{Traditional mean-VaR}:
 In the early 90's, academic literature started referring to \dQuote{value at risk}, typically written as VaR. Take care to capitalize VaR in the commonly accepted manner, to avoid confusion with var (variance) and VAR (vector auto-regression).  With a sufficiently large data set, you may choose to use a non-parametric VaR estimation method using the historical distribution and the probability quantile of the distribution calculated using \code{\link{qnorm}}. The negative return at the correct quantile (usually 95\% or 99\%), is the non-parametric VaR estimate.  J.P. Morgan's RiskMetrics parametric mean-VaR was published in 1994 and this methodology for estimating parametric mean-VaR has become what people are generally referring to as \dQuote{VaR} and what we have implemented as \code{\link{VaR}} with \code{method="historical"}.  See \cite{Return to RiskMetrics: Evolution of a Standard} at \url{http://www.riskmetrics.com/r2rovv.html}. Parametric traditional VaR does a better job of accounting for the tails of the distribution by more precisely estimating the tails below the risk quantile.  It is still insufficient if the assets have a distribution that varies widely from normality.  That is available in \code{\link{VaR}} with \code{method="gaussian"}.
 
-The \R package \code{VaR}, now orphaned, contains methods for simulating and estimating lognormal \kbd{VaR.norm} and generalized Pareto \kbd{VaR.gpd} distributions to overcome some of the problems with nonparametric or parametric mean-VaR calculations on a limited sample size.  There is also a \kbd{VaR.backtest} function to apply simulation methods to create a more robust estimate of the potential distribution of losses.  The \code{VaR} package also provides plots for its functions.  We will attempt to incoporate this orphaned functionality in PerformanceAnalytics in an upcoming release.
+The \R package VaR, now orphaned, contains methods for simulating and estimating lognormal \kbd{VaR.norm} and generalized Pareto \kbd{VaR.gpd} distributions to overcome some of the problems with nonparametric or parametric mean-VaR calculations on a limited sample size.  There is also a \kbd{VaR.backtest} function to apply simulation methods to create a more robust estimate of the potential distribution of losses.  The VaR package also provides plots for its functions.  We will attempt to incoporate this orphaned functionality in PerformanceAnalytics in an upcoming release.
 
 \emph{Modified Cornish-Fisher VaR}:
 The limitations of traditional mean-VaR are all related to the use of a symmetrical distribution function.  Use of simulations, resampling, or Pareto distributions all help in making a more accurate prediction, but they are still flawed for assets with significantly non-normal (skewed and/or kurtotic) distributions. \cite{Huisman (1999)} and \cite{Favre and Galleano (2002)} propose to overcome this extensively documented failing of traditional VaR by directly incorporating the higher moments of the return distribution into the VaR calculation.  

Modified: pkg/PerformanceAnalytics/man/TreynorRatio.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/TreynorRatio.Rd	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/man/TreynorRatio.Rd	2012-08-10 09:10:36 UTC (rev 2230)
@@ -1,12 +1,9 @@
 \name{TreynorRatio}
-\alias{ModifiedTreynorRatio}
 \alias{TreynorRatio}
 \title{calculate Treynor Ratio or modified Treynor Ratio of excess return over CAPM beta}
 \usage{
   TreynorRatio(Ra, Rb, Rf = 0, scale = NA,
     modified = FALSE)
-
-  ModifiedTreynorRatio(Ra, Rb, Rf = 0, scale = NA)
 }
 \arguments{
   \item{Ra}{an xts, vector, matrix, data frame, timeSeries

Modified: pkg/PerformanceAnalytics/man/VaR.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/VaR.Rd	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/man/VaR.Rd	2012-08-10 09:10:36 UTC (rev 2230)
@@ -170,11 +170,8 @@
 }
 \seealso{
   \code{\link{SharpeRatio.modified}} \cr
-  \code{\link{chart.VaRSensitivity}} \cr %
-  \code{\link[VaR]{VaR.gpd}} \cr %
-  \code{\link[VaR]{VaR.norm}} \cr %
-  \code{\link[VaR]{VaR.backtest}} \cr
-  \code{\link{Return.clean}} \cr
+  \code{\link{chart.VaRSensitivity}} \cr
+  \code{\link{Return.clean}}
 }
 \keyword{distribution}
 \keyword{models}

Modified: pkg/PerformanceAnalytics/man/chart.RollingRegression.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.RollingRegression.Rd	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/man/chart.RollingRegression.Rd	2012-08-10 09:10:36 UTC (rev 2230)
@@ -36,6 +36,12 @@
   would not otherwise have been in the result with a value
   of NA. If FALSE those times are dropped.}
 
+  \item{legend.loc}{used to set the position of the legend}
+
+  \item{event.labels}{if not null and event.lines is not
+  null, this will apply a list of text labels to the
+  vertical lines drawn}
+
   \item{\dots}{any other passthru parameters to
   \code{\link{chart.TimeSeries}}}
 }

Modified: pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd	2012-08-10 09:10:36 UTC (rev 2230)
@@ -132,6 +132,8 @@
   \item{xaxis.labels}{Allows for non-date labeling of date
   axes, default is NULL}
 
+  \item{space}{default 0}
+
   \item{\dots}{any other passthru parameters}
 }
 \description{

Modified: pkg/PerformanceAnalytics/man/mean.geometric.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/mean.geometric.Rd	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/man/mean.geometric.Rd	2012-08-10 09:10:36 UTC (rev 2230)
@@ -7,13 +7,13 @@
 \title{calculate attributes relative to the mean of the observation series given,
 including geometric, stderr, LCL and UCL}
 \usage{
-  mean.geometric(x, ...)
+  \method{mean}{geometric} (x, ...)
 
-  mean.stderr(x, ...)
+  \method{mean}{stderr} (x, ...)
 
-  mean.LCL(x, ci = 0.95, ...)
+  \method{mean}{LCL} (x, ci = 0.95, ...)
 
-  mean.UCL(x, ci = 0.95, ...)
+  \method{mean}{UCL} (x, ci = 0.95, ...)
 }
 \arguments{
   \item{x}{a vector, matrix, data frame, or time series to

Modified: pkg/PerformanceAnalytics/man/textplot.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/textplot.Rd	2012-08-09 15:35:30 UTC (rev 2229)
+++ pkg/PerformanceAnalytics/man/textplot.Rd	2012-08-10 09:10:36 UTC (rev 2230)
@@ -21,7 +21,7 @@
     col.colnames = par("col"), wrap = TRUE,
     wrap.colnames = 10, wrap.rownames = 10, ...)
 
-  textplot.default(object,
+  \method{textplot}{default} (object,
     halign = c("center", "left", "right"),
     valign = c("center", "top", "bottom"), cex, max.cex,
     cmar, rmar, show.rownames, show.colnames, hadj, vadj,
@@ -29,7 +29,7 @@
     col.rownames, col.colnames, wrap, wrap.colnames,
     wrap.rownames, ...)
 
-  textplot.data.frame(object,
+  \method{textplot}{data.frame} (object,
     halign = c("center", "left", "right"),
     valign = c("center", "top", "bottom"), cex,
     max.cex = 1, cmar = 2, rmar = 0.5,
@@ -40,7 +40,7 @@
     col.colnames = par("col"), wrap = TRUE,
     wrap.colnames = 10, wrap.rownames = 10, ...)
 
-  textplot.matrix(object,
+  \method{textplot}{matrix} (object,
     halign = c("center", "left", "right"),
     valign = c("center", "top", "bottom"), cex,
     max.cex = 1, cmar = 2, rmar = 0.5,
@@ -51,7 +51,7 @@
     col.colnames = par("col"), wrap = TRUE,
     wrap.colnames = 10, wrap.rownames = 10, ...)
 
-  textplot.character(object,
+  \method{textplot}{character} (object,
     halign = c("center", "left", "right"),
     valign = c("center", "top", "bottom"), cex,
     max.cex = 1, cmar = 2, rmar = 0.5,
@@ -128,6 +128,14 @@
 
   \item{\dots}{Optional arguments passed to the text
   plotting command or specialized object methods}
+
+  \item{fixed.width}{default is TRUE}
+
+  \item{cspace}{default is 1}
+
+  \item{lspace}{default is 1}
+
+  \item{tab.width}{default is 8}
 }
 \description{
   This function displays text output in a graphics window.



More information about the Returnanalytics-commits mailing list