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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Feb 9 00:08:03 CET 2014


Author: tfillebeen
Date: 2014-02-09 00:08:01 +0100 (Sun, 09 Feb 2014)
New Revision: 79

Modified:
   pkg/GARPFRM/R/EWMA.R
Log:
generic applied to plot and warning added

Modified: pkg/GARPFRM/R/EWMA.R
===================================================================
--- pkg/GARPFRM/R/EWMA.R	2014-02-08 18:59:12 UTC (rev 78)
+++ pkg/GARPFRM/R/EWMA.R	2014-02-08 23:08:01 UTC (rev 79)
@@ -129,7 +129,7 @@
 #' @S3method getCov EWMAVar
 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")}
+  if (is.null(asset2) == FALSE) {warning("Running univariate EWMA leave asset2 unspecified")}
   # Manipulate object for feasible use  
   # object[[length(object)]] = NULL
   
@@ -202,7 +202,7 @@
     idx1 = asset1
     idx2 = asset2
   }
-  tmp = getCov(object, asset1, asset2)
+  tmp = getCov(object,..., asset1, asset2)
   plot(x=time(as.zoo(tmp)), y=tmp, type="l", xlab="Time", ylab="Covariance", lwd=2, col="blue",
        main="EWMA Covariance");
   grid()
@@ -212,7 +212,7 @@
 
 # EWMA plotting for var
 #' @export
-plot.EWMAVar <- function(object,asset1){
+plot.EWMAVar <- function(object,...,asset1){
   tmp = getCov(object,asset1)
   plot(x=time(as.zoo(tmp)),y=tmp, type="l", xlab="Time", ylab="Variance", lwd=2, col="blue",
        main="EWMA Variance");
@@ -223,7 +223,7 @@
 
 # EWMA plotting for correlation
 #' @export
-plot.EWMACor <- function(object, asset1, asset2){
+plot.EWMACor <- function(object, ...,asset1, asset2){
   # Check if asset is a character 
   if(is.character(asset1) & is.character(asset2)){
     idx1 = grep(asset1, colnames(object[[1]]))



More information about the Uwgarp-commits mailing list