[Uwgarp-commits] r77 - pkg/GARPFRM/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 8 19:50:40 CET 2014


Author: tfillebeen
Date: 2014-02-08 19:50:39 +0100 (Sat, 08 Feb 2014)
New Revision: 77

Modified:
   pkg/GARPFRM/R/EWMA.R
Log:
Generic

Modified: pkg/GARPFRM/R/EWMA.R
===================================================================
--- pkg/GARPFRM/R/EWMA.R	2014-02-08 18:30:43 UTC (rev 76)
+++ pkg/GARPFRM/R/EWMA.R	2014-02-08 18:50:39 UTC (rev 77)
@@ -71,7 +71,6 @@
   
   # Check correlation option
   if(cor & ncol(R) > 1) {
-    # Why not just make it equal to out why create new list item.
     out$EWMA <- lapply(out$EWMA, cov2cor)
     class(out) <- c("EWMACor")
   } else if(cor & ncol(R)==1) {
@@ -91,9 +90,6 @@
   return(out)
 }
 
-# The arguments for getCov.* must match the arguments for your getCov generic
-# method
-
 #' EWMA Volatility/Cross-Volatility
 #' 
 #' Description of EWMA Vola
@@ -131,8 +127,9 @@
 
 #' @method getCov EWMAVar
 #' @S3method getCov EWMAVar
-getCov.EWMAVar <- function(object, asset1){
+getCov.EWMAVar <- function(object, asset1, asset2){
   if(!inherits(object, "EWMAVar")) stop("object must be of class EWMAVar")
+  if (is.null(asset2) == FALSE) {stop("Running univariate EWMA leave asset2 unspecified")}
   # Manipulate object for feasible use  
   # object[[length(object)]] = NULL
   
@@ -212,7 +209,6 @@
   abline(h=var(object$R)[idx1,idx2], lwd=2, col="red")
 }
 
-# plot.EWMAVar(x, y, ..., asset1)
 
 # EWMA plotting for var
 #' @export
@@ -224,7 +220,6 @@
   abline(h=var(object$R), lwd=2, col="red")
 }
 
-# plot.EWMACor(x, y, ..., asset1, asset2)
 
 # EWMA plotting for correlation
 #' @export



More information about the Uwgarp-commits mailing list