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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 8 04:58:09 CEST 2013


Author: shubhanm
Date: 2013-09-08 04:58:07 +0200 (Sun, 08 Sep 2013)
New Revision: 3023

Modified:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/Return.GLM.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.ComparitiveReturn.GLM.R
Log:
crosschecked  with literature formula 

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/Return.GLM.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/Return.GLM.R	2013-09-07 20:45:33 UTC (rev 3022)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/Return.GLM.R	2013-09-08 02:58:07 UTC (rev 3023)
@@ -50,7 +50,7 @@
     
     clean.GLM <- function(column.R,q=3) {
       ma.coeff = as.numeric((arma(column.R,order=c(0,q)))$coef[1:q])
- column.glm = ma.coeff[q]*lag(column.R,q)
+ column.glm = (1-ma.coeff[q])*lag(column.R,q)
      
     return(column.glm)
     }

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.ComparitiveReturn.GLM.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.ComparitiveReturn.GLM.R	2013-09-07 20:45:33 UTC (rev 3022)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.ComparitiveReturn.GLM.R	2013-09-08 02:58:07 UTC (rev 3023)
@@ -44,12 +44,16 @@
       x = y[,column]
       x=na.omit(x)
       skew = skewness(x)
-      arma.coeff= arma(x,order=c(0,n))
+    #  arma.coeff= arma(x,order=c(0,n))
       kurt= kurtosis(x)
-      z = c(skew,
-            ((sum(as.numeric(arma.coeff$coef[1:n])^2)^1.5)*(skew/(sum(as.numeric(arma.coeff$coef[1:n])^3)))),
-            kurt,
-             (-kurt*(sum(as.numeric(arma.coeff$coef[1:n])^2)^2-6*(sum(as.numeric(arma.coeff$coef[1:n])^2)*sum(as.numeric(arma.coeff$coef[1:n])^2)))/(sum(as.numeric(arma.coeff$coef[1:n])^4))))
+     # z = c(skew,
+      #      ((sum(as.numeric(arma.coeff$coef[1:n])^2)^1.5)*(skew/(sum(as.numeric(arma.coeff$coef[1:n])^3)))),
+       #     kurt,
+        #     (abs(kurt*(sum(as.numeric(arma.coeff$coef[1:n])^2)^2/6-(sum(as.numeric(arma.coeff$coef[1:n])^2)*sum(as.numeric(arma.coeff$coef[1:n])^2)))/(sum(as.numeric(arma.coeff$coef[1:n])^4)))))
+      aa=Return.GLM(x)
+      skew1=skewness(aa)
+      kurt1=kurtosis(aa)
+      z=c(skew,skew1,kurt,kurt1)
       znames = c(
         "Skewness ( Orignal) ",
         "Skewness (Unsmooth)",



More information about the Returnanalytics-commits mailing list