[Yuima-commits] r302 - pkg/yuima/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 22 17:16:09 CEST 2014


Author: iacus
Date: 2014-04-22 17:16:08 +0200 (Tue, 22 Apr 2014)
New Revision: 302

Modified:
   pkg/yuima/R/yuima.R
Log:
added show method

Modified: pkg/yuima/R/yuima.R
===================================================================
--- pkg/yuima/R/yuima.R	2014-04-22 14:57:19 UTC (rev 301)
+++ pkg/yuima/R/yuima.R	2014-04-22 15:16:08 UTC (rev 302)
@@ -282,7 +282,8 @@
     is.wienerdiff <- FALSE
     is.fracdiff <- FALSE
     is.jumpdiff <- FALSE
-    
+    is.carma <- FALSE
+
     if(length(mod at drift)>0) has.drift <- TRUE
     if(length(mod at diffusion)>0) has.diff <- TRUE
     if(length(mod at jump.coeff)>0) has.levy <- TRUE
@@ -291,18 +292,25 @@
     if( has.drift | has.diff ) is.wienerdiff <- TRUE
     if( has.fbm  ) is.fracdiff <- TRUE
     if( has.levy ) is.jumpdiff <- TRUE
-    if( try(eval(mod at diffusion[[1]])) == 0){
+    if( try(eval(mod at diffusion[[1]]), silent=TRUE) == 0){
      has.diff <- FALSE
      is.wienerdiff <- FALSE
      is.fracdiff <- FALSE
     }
+    if( class(mod) == "yuima.carma")
+     is.carma <- TRUE
+     
     if( is.wienerdiff | is.fracdiff | is.jumpdiff  ){
-        if( is.wienerdiff )
-        cat("\nDiffusion process")
-        if( is.fracdiff & mod at hurst!=0.5)
-        cat(sprintf(" with Hurst index:%.2f", mod at hurst))
+        if( is.wienerdiff & ! is.carma){
+         cat("\nDiffusion process")
+         if( is.fracdiff & mod at hurst!=0.5)
+         cat(sprintf(" with Hurst index:%.2f", mod at hurst))
+        }
+        if(is.carma)
+          cat(sprintf("\nCarma process p=%d, q=%d", mod at info@p, mod at info@q))
+        
         if( is.jumpdiff ){
-            if( is.wienerdiff ){
+            if( is.wienerdiff | is.carma ){
                 cat(" with Levy jumps")
             } else {
                 cat("Levy jump process")
@@ -311,7 +319,7 @@
         
         cat(sprintf("\nNumber of equations: %d", mod at equation.number))
         if(is.wienerdiff | is.fracdiff)
-         cat(sprintf("\nNumber of Wiener noises: %d", length(mod at diffusion)))
+         cat(sprintf("\nNumber of Wiener noises: %d", mod at noise.number))
         if(is.jumpdiff)
          cat(sprintf("\nNumber of Levy noises: %d", 1))
     }



More information about the Yuima-commits mailing list