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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 2 14:17:01 CET 2017


Author: lorenzo
Date: 2017-12-02 14:17:00 +0100 (Sat, 02 Dec 2017)
New Revision: 634

Modified:
   pkg/yuima/R/lambdaPPR.R
Log:


Modified: pkg/yuima/R/lambdaPPR.R
===================================================================
--- pkg/yuima/R/lambdaPPR.R	2017-11-29 17:49:46 UTC (rev 633)
+++ pkg/yuima/R/lambdaPPR.R	2017-12-02 13:17:00 UTC (rev 634)
@@ -225,9 +225,10 @@
 
     #CountingVariable
     for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
-      cond <- yuimaPPr at Ppr@counting.var[i] %in% yuimaPPr at model@solve.variable
-      dummyData <-unique(yuimaPPr at data@original.data[,cond])[-1]
-      assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd1)
+      cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@counting.var[i] 
+      condTime <- gridTime %in% my.envd1$JumpTime.dN
+      dummyData <- yuimaPPr at data@original.data[condTime,cond]
+      assign(yuimaPPr at Ppr@counting.var[i], as.numeric(dummyData),envir=my.envd1)
     }
     # Names expression
     assign("NamesIntgra", NamesIntegrandExpr, envir=my.envd1)
@@ -256,9 +257,14 @@
     assign("t.time",yuimaPPr at Kernel@variable.Integral at upper.var,envir=my.envd1)
 
     # Covariates
-    if(length(yuimaPPr at Ppr@covariates)>1){
+    if(length(yuimaPPr at Ppr@covariates)>0){
       # Covariates should be identified at jump time
-      return(NULL)
+      # return(NULL)
+      for(i in c(1:length(yuimaPPr at Ppr@covariates))){
+        cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@covariates[i]  
+        dummyData <-yuimaPPr at data@original.data[,cond]
+        assign(yuimaPPr at Ppr@covariates[i], dummyData,envir=my.envd1)
+      }
     }
 
   }
@@ -288,7 +294,7 @@
   dimCov <- length(yuimaPPr at Ppr@covariates)
   if(dimCov>0){
     for(j in c(1:dimCov)){
-      cond <- yuimaPPr at Ppr@covariates[j] %in% yuimaPPr at model@solve.variable
+      cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@covariates[j]
       dummyData <-yuimaPPr at data@original.data[,cond]
       assign(yuimaPPr at Ppr@covariates[j], dummyData,envir=my.envd3)  
     }
@@ -296,7 +302,7 @@
 
   #CountingVariable
   for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
-    cond <- yuimaPPr at Ppr@counting.var[i] %in% yuimaPPr at model@solve.variable
+    cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@counting.var[i]
     dummyData <-yuimaPPr at data@original.data[,cond]
     assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd3)
   }



More information about the Yuima-commits mailing list