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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 7 10:33:54 CEST 2012


Author: matthieu_lestel
Date: 2012-08-07 10:33:54 +0200 (Tue, 07 Aug 2012)
New Revision: 2223

Added:
   pkg/PerformanceAnalytics/man/portfolio_bacon.Rd
Modified:
   pkg/PerformanceAnalytics/R/DownsideDeviation.R
   pkg/PerformanceAnalytics/R/MartinRatio.R
   pkg/PerformanceAnalytics/R/PainRatio.R
   pkg/PerformanceAnalytics/R/TreynorRatio.R
   pkg/PerformanceAnalytics/R/VolatilitySkewness.R
Log:
documentation of portfolio_bacon data + other modification to fix warnings in R CMD check

Modified: pkg/PerformanceAnalytics/R/DownsideDeviation.R
===================================================================
--- pkg/PerformanceAnalytics/R/DownsideDeviation.R	2012-08-05 22:11:32 UTC (rev 2222)
+++ pkg/PerformanceAnalytics/R/DownsideDeviation.R	2012-08-07 08:33:54 UTC (rev 2223)
@@ -174,7 +174,6 @@
         return(DownsideDeviation(R, MAR=MAR, method="full", potential=TRUE))
     }
     else {
-        print("doit être format avec date")
         R = checkData(R)
         result = apply(R, MARGIN = 2, DownsidePotential, MAR = MAR)
         result = matrix(result, nrow=1)
@@ -182,15 +181,4 @@
         rownames(result) = paste("Downside Potential (MAR = ", round(mean(MAR),1),"%)", 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$
-#
-###############################################################################
+}
\ No newline at end of file

Modified: pkg/PerformanceAnalytics/R/MartinRatio.R
===================================================================
--- pkg/PerformanceAnalytics/R/MartinRatio.R	2012-08-05 22:11:32 UTC (rev 2222)
+++ pkg/PerformanceAnalytics/R/MartinRatio.R	2012-08-07 08:33:54 UTC (rev 2223)
@@ -55,7 +55,7 @@
        return(result)
     }
     else {
-        result = apply(R, MARGIN = 2, MartinRatio, MAR = MAR, Rf = Rf, ...)
+        result = apply(R, MARGIN = 2, MartinRatio, Rf = Rf, ...)
         result<-t(result)
         colnames(result) = colnames(R)
         rownames(result) = paste("Martin Ratio (Rf = ",Rf,")", sep="")

Modified: pkg/PerformanceAnalytics/R/PainRatio.R
===================================================================
--- pkg/PerformanceAnalytics/R/PainRatio.R	2012-08-05 22:11:32 UTC (rev 2222)
+++ pkg/PerformanceAnalytics/R/PainRatio.R	2012-08-07 08:33:54 UTC (rev 2223)
@@ -56,7 +56,7 @@
        return(result)
     }
     else {
-        result = apply(R, MARGIN = 2, PainRatio, MAR = MAR, Rf = Rf, period = period, ...)
+        result = apply(R, MARGIN = 2, PainRatio, Rf = Rf, period = period, ...)
         result<-t(result)
         colnames(result) = colnames(R)
         rownames(result) = paste("Pain Ratio (Rf = ",Rf,")", sep="")

Modified: pkg/PerformanceAnalytics/R/TreynorRatio.R
===================================================================
--- pkg/PerformanceAnalytics/R/TreynorRatio.R	2012-08-05 22:11:32 UTC (rev 2222)
+++ pkg/PerformanceAnalytics/R/TreynorRatio.R	2012-08-07 08:33:54 UTC (rev 2223)
@@ -175,7 +175,7 @@
 	
 	if (ncol(Ra)==1 || is.null(Ra) || is.vector(Ra)) {
 		
-		Rp = (prod(1+R/100)^(scale/length(R))-1)*100
+		Rp = (prod(1+Ra/100)^(scale/length(R))-1)*100
 		for (i in (1:length(Ra))) {
 			if (!is.na(Ra[i])) {
 				calcul = TRUE

Modified: pkg/PerformanceAnalytics/R/VolatilitySkewness.R
===================================================================
--- pkg/PerformanceAnalytics/R/VolatilitySkewness.R	2012-08-05 22:11:32 UTC (rev 2222)
+++ pkg/PerformanceAnalytics/R/VolatilitySkewness.R	2012-08-07 08:33:54 UTC (rev 2223)
@@ -56,7 +56,7 @@
 
         if(!is.null(dim(MAR))){
             if(is.timeBased(index(MAR))){
-                MAR <-MAR[index(r)] #subset to the same dates as the R data
+                MAR <-MAR[index(R)] 
             } 
 	    else{
                 MAR = mean(checkData(MAR, method = "vector"))

Added: pkg/PerformanceAnalytics/man/portfolio_bacon.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/portfolio_bacon.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/man/portfolio_bacon.Rd	2012-08-07 08:33:54 UTC (rev 2223)
@@ -0,0 +1,24 @@
+\name{portfolio_bacon}
+\docType{data}
+\alias{portfolio_bacon}
+\title{Bacon(2008) Data}
+\description{
+A xts object that contains columns of monthly returns for an example of portfolio
+and its benchmark
+}
+\usage{portfolio_bacon}
+\format{CSV conformed into an xts object with monthly observations}
+\examples{
+data(portfolio_bacon)
+
+#preview the data
+head(portfolio_bacon)
+
+#summary period statistics
+summary(portfolio_bacon)
+
+#cumulative returns
+tail(cumprod(1+portfolio_bacon),1)
+}
+\keyword{datasets}
+\keyword{ ts }
\ No newline at end of file



More information about the Returnanalytics-commits mailing list