[Returnanalytics-commits] r3017 - pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Sep 7 14:22:10 CEST 2013


Author: shubhanm
Date: 2013-09-07 14:22:09 +0200 (Sat, 07 Sep 2013)
New Revision: 3017

Modified:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/ACStdDev.annualized.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/chart.Autocorrelation.R
Log:
chart.Autocorrelation.R : Stacked chart used
ACFSTDEv : na's handling added

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/ACStdDev.annualized.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/ACStdDev.annualized.R	2013-09-07 11:19:40 UTC (rev 3016)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/ACStdDev.annualized.R	2013-09-07 12:22:09 UTC (rev 3017)
@@ -46,7 +46,8 @@
     
     for(column.a in 1:columns.a) { # for each asset passed in as R
       # clean the data and get rid of NAs
-      column.return = R[,column.a]
+     # column.return = R[,column.a]
+      column.return = na.omit(R[,column.a])
       acf = as.numeric(acf(as.numeric(column.return), plot = FALSE)[1:lag][[1]])
       coef= sum(acf*acf)
       if(!xtsible(R) & is.na(scale))

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/chart.Autocorrelation.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/chart.Autocorrelation.R	2013-09-07 11:19:40 UTC (rev 3016)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/chart.Autocorrelation.R	2013-09-07 12:22:09 UTC (rev 3017)
@@ -35,13 +35,13 @@
 # Graph autos with adjacent bars using rainbow colors
  
 aa= table.Autocorrelation(R)
-    barplot(as.matrix(aa), main="ACF Lag Plot", ylab= "Value of Coefficient",
-                   , xlab = NULL,col=rich6equal)
+    chart.StackedBar(as.matrix(aa), main="ACF Lag Plot", ylab= "Value of Coefficient",
+                   , xlab = NULL,col=bluemono)
 
    # Place the legend at the top-left corner with no frame  
    # using rainbow colors
-   legend("topright", c("1","2","3","4","5","6"), cex=0.6, 
-                   bty="n", fill=rich6equal);
+   #legend("topright", c("1","2","3","4","5","6"), cex=0.6, 
+#                   bty="n", fill=rich6equal);
 
 
 



More information about the Returnanalytics-commits mailing list