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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 27 19:10:07 CEST 2012


Author: braverock
Date: 2012-07-27 19:10:06 +0200 (Fri, 27 Jul 2012)
New Revision: 2214

Modified:
   pkg/PerformanceAnalytics/R/ES.R
   pkg/PerformanceAnalytics/R/MultivariateMoments.R
   pkg/PerformanceAnalytics/man/ES.Rd
Log:
- fix component ES multivariat moments bug, reported by Eric Zivot

Modified: pkg/PerformanceAnalytics/R/ES.R
===================================================================
--- pkg/PerformanceAnalytics/R/ES.R	2012-07-27 16:02:39 UTC (rev 2213)
+++ pkg/PerformanceAnalytics/R/ES.R	2012-07-27 17:10:06 UTC (rev 2214)
@@ -113,7 +113,7 @@
 #'     ES(edhec, clean="boudt")
 #' 
 #'     # add Component ES for the equal weighted portfolio
-#'     #ES(edhec, clean="boudt", portfolio_method="component")
+#'     ES(edhec, clean="boudt", portfolio_method="component")
 #' 
 ETL <- CVaR <- ES <- function (R=NULL , p=0.95, ..., 
         method=c("modified","gaussian","historical", "kernel"), 

Modified: pkg/PerformanceAnalytics/R/MultivariateMoments.R
===================================================================
--- pkg/PerformanceAnalytics/R/MultivariateMoments.R	2012-07-27 16:02:39 UTC (rev 2213)
+++ pkg/PerformanceAnalytics/R/MultivariateMoments.R	2012-07-27 17:10:06 UTC (rev 2214)
@@ -18,7 +18,7 @@
 
 M3.MM = function(R,...){
    cAssets = ncol(R); T = nrow(R);
-   if(!hasArg(mu)) mu = apply(R,2,'mean') else mu=match.call(expand.dots=TRUE)$mu
+   if(!hasArg(mu)) mu = apply(R,2,'mean') else mu=mu=list(...)$mu
    M3 = matrix(rep(0,cAssets^3),nrow=cAssets,ncol=cAssets^2)
    for(t in c(1:T))
    {
@@ -30,7 +30,7 @@
 
 M4.MM = function(R,...){
    cAssets = ncol(R); T = nrow(R);
-   if(!hasArg(mu))   mu = apply(R,2,'mean') else mu=match.call(expand.dots=TRUE)$mu
+   if(!hasArg(mu))   mu = apply(R,2,'mean')  else mu=list(...)$mu
    M4 = matrix(rep(0,cAssets^4),nrow=cAssets,ncol=cAssets^3);
    for(t in c(1:T))
    {

Modified: pkg/PerformanceAnalytics/man/ES.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/ES.Rd	2012-07-27 16:02:39 UTC (rev 2213)
+++ pkg/PerformanceAnalytics/man/ES.Rd	2012-07-27 17:10:06 UTC (rev 2214)
@@ -124,7 +124,7 @@
     ES(edhec, clean="boudt")
 
     # add Component ES for the equal weighted portfolio
-    #ES(edhec, clean="boudt", portfolio_method="component")
+    ES(edhec, clean="boudt", portfolio_method="component")
 }
 \author{
   Brian G. Peterson and Kris Boudt



More information about the Returnanalytics-commits mailing list