[Returnanalytics-commits] r2815 - in pkg/PerformanceAnalytics/sandbox/pulkit: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 18 11:14:31 CEST 2013


Author: pulkit
Date: 2013-08-18 11:14:30 +0200 (Sun, 18 Aug 2013)
New Revision: 2815

Removed:
   pkg/PerformanceAnalytics/sandbox/pulkit/R/edd.R
Modified:
   pkg/PerformanceAnalytics/sandbox/pulkit/
   pkg/PerformanceAnalytics/sandbox/pulkit/.Rbuildignore
   pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
   pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R
   pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.Penance.Rd
Log:
deleted edd.R and conflict resolved


Property changes on: pkg/PerformanceAnalytics/sandbox/pulkit
___________________________________________________________________
Added: svn:ignore
   + .Rproj.user
.Rhistory
.RData


Modified: pkg/PerformanceAnalytics/sandbox/pulkit/.Rbuildignore
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/.Rbuildignore	2013-08-18 05:36:30 UTC (rev 2814)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/.Rbuildignore	2013-08-18 09:14:30 UTC (rev 2815)
@@ -3,3 +3,5 @@
 ChangeLog\.1\.0\.0
 week*
 Week*
+^.*\.Rproj$
+^\.Rproj\.user$

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE	2013-08-18 05:36:30 UTC (rev 2814)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE	2013-08-18 09:14:30 UTC (rev 2815)
@@ -1,10 +1,10 @@
 export(AlphaDrawdown)
-export(BenchmarkSR)
-export(chart.BenchmarkSR)
-export(chart.SRIndifference)
-export(EconomicDrawdown)
-export(EDDCOPS)
-export(MinTrackRecord)
-export(REDDCOPS)
-export(rollDrawdown)
-export(rollEconomicMax)
+#export(BenchmarkSR)
+#export(chart.BenchmarkSR)
+#export(chart.SRIndifference)
+#export(EconomicDrawdown)
+#export(EDDCOPS)
+#export(MinTrackRecord)
+#export(REDDCOPS)
+#export(rollDrawdown)
+#export(rollEconomicMax)

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R	2013-08-18 05:36:30 UTC (rev 2814)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R	2013-08-18 09:14:30 UTC (rev 2815)
@@ -71,6 +71,7 @@
     }
     
   }
+  vs = vs[1]
   corr = table.Correlation(edhec,edhec)
   corr_avg = 0
   for(i in 1:(columns-1)){

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R	2013-08-18 05:36:30 UTC (rev 2814)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R	2013-08-18 09:14:30 UTC (rev 2815)
@@ -29,9 +29,7 @@
 #'Zabarankin, M., Pavlikov, K., and S. Uryasev. Capital Asset Pricing Model 
 #'(CAPM) with Drawdown Measure.Research Report 2012-9, ISE Dept., University 
 #'of Florida,September 2012.
-#'
 #'@examples
-#'
 #'AlphaDrawdown(edhec[,1],edhec[,2]) ## expected value : 0.5141929
 #'
 #'AlphaDrawdown(edhec[,1],edhec[,2],type="max") ## expected value : 0.8983177

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R	2013-08-18 05:36:30 UTC (rev 2814)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R	2013-08-18 09:14:30 UTC (rev 2815)
@@ -31,9 +31,8 @@
 #'@seealso \code{\link{plot}}
 #'@keywords ts multivariate distribution models hplot
 #'@examples
-#'ls()
+#'chart.Penance(edhec,0.95)
 #'
-#'
 #'@references Bailey, David H. and Lopez de Prado, Marcos,Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
 
 chart.Penance<-function(R,confidence,type=c("ar","normal"),reference.grid = TRUE,main=NULL,ylab = NULL,xlab = NULL,element.color="darkgrey",lwd = 2,pch = 1,cex = 1,cex.axis=0.8,cex.lab = 1,cex.main = 1,xlim = NULL,ylim = NULL,...){

Deleted: pkg/PerformanceAnalytics/sandbox/pulkit/R/edd.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/edd.R	2013-08-18 05:36:30 UTC (rev 2814)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/edd.R	2013-08-18 09:14:30 UTC (rev 2815)
@@ -1,84 +0,0 @@
-#'@title Calculate the Economic Drawdown
-#'
-#'@description
-#'\code{EconomicDrawdown} calculates the  Economic Drawdown(EDD) for
-#'a return series.To calculate the economic drawdown cumulative 
-#'return and economic max is calculated for each point. The risk 
-#'free return(rf)  is taken as the input.
-#'
-#'Economic Drawdown is given by the equation
-#'
-#'\deqn{EDD(t)=1-\frac{W_t}/{EM(t)}}
-#'
-#'Here EM stands for Economic Max and is the code \code{\link{EconomicMax}}
-#' 
-#'
-#'@param R an xts, vector, matrix, data frame, timeseries, or zoo object of asset return.
-#'@param Rf risk free rate can be vector such as government security rate of return 
-#'@param geometric utilize geometric chaining (TRUE) or simple/arithmetic chaining(FALSE)
-#'to aggregate returns, default is TRUE
-#'@param \dots any other  variable
-#'@references Yang, Z. George and Zhong, Liang, Optimal Portfolio Strategy to 
-#'Control Maximum Drawdown - The Case of Risk Based Dynamic Asset Allocation (February 25, 2012)
-#'@examples
-#'EconomicDrawdown(edhec,0.08,100)
-#'
-#' @export
-EconomicDrawdown<-function(R,Rf,h, geometric = TRUE,...)
-{
-  
-  # DESCRIPTION:
-  # calculates the Economic Drawdown(EDD) for
-  # a return series.To calculate the economic drawdown cumulative 
-  # return and rolling economic max is calculated for each point. The risk 
-  # free return(rf) is taken as the input.
-  
-  # FUNCTION:
-  x = checkData(R)
-  columns = ncol(x)
-  n = nrow(x)
-  columnnames = colnames(x)
-  rf = checkData(Rf)
-  nr = length(Rf)
-  if(nr != 1 && nr != n ){
-    stop("The number of rows of the returns and the risk free rate do not match")
-  }
-  
-  EDD<-function(xh,geometric){
-    if(geometric)
-      Return.cumulative = cumprod(1+xh)
-    else Return.cumulative = 1 + cumsum(xh)
-    l = length(Return.cumulative)
-    if(nr == 1){
-      EM = max(Return.cumulative*(1+rf)^(l-c(1:l)))
-    }
-    else{
-      rf = rf[index(xh)]
-      prodRf = cumprod(1+rf)
-      EM = max(Return.cumulative*as.numeric(last(prodRf)/prodRf))
-    }
-    result = 1 - last(Return.cumulative)/EM
-  }
-  
-  for(column in 1:columns){
-    column.drawdown <- na.skip(x[,column], FUN = EDD, geometric = geometric)
-    if(column == 1)
-      Economicdrawdown = column.drawdown
-    else Economicdrawdown = merge(Economicdrawdown, column.drawdown) 
-  }
-  colnames(Economicdrawdown) = columnnames
-  Economicdrawdown = reclass(Economicdrawdown, x)
-  return(Economicdrawdown)
-}
-
-###############################################################################
-# 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: edd.R $
-#
-##############################################################################

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.Penance.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.Penance.Rd	2013-08-18 05:36:30 UTC (rev 2814)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.Penance.Rd	2013-08-18 09:14:30 UTC (rev 2815)
@@ -76,7 +76,7 @@
   water.
 }
 \examples{
-ls()
+chart.Penance(edhec,0.95)
 }
 \references{
   Bailey, David H. and Lopez de Prado,



More information about the Returnanalytics-commits mailing list