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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 22 12:39:57 CET 2017


Author: lorenzo
Date: 2017-11-22 12:39:56 +0100 (Wed, 22 Nov 2017)
New Revision: 630

Modified:
   pkg/yuima/R/AuxMethodforPPR.R
   pkg/yuima/R/simulateForPpr.R
Log:


Modified: pkg/yuima/R/AuxMethodforPPR.R
===================================================================
--- pkg/yuima/R/AuxMethodforPPR.R	2017-10-08 09:51:44 UTC (rev 629)
+++ pkg/yuima/R/AuxMethodforPPR.R	2017-11-22 11:39:56 UTC (rev 630)
@@ -17,7 +17,7 @@
   #   Integr1 <- -10^6
   # }
   cond2 <- diff(as.numeric(my.envd3$YUIMA.PPR at data@original.data))
-  Integr2<- sum(log(IntLambda[-1][cond2>0]),na.rm=TRUE)
+  Integr2<- sum(log(IntLambda[-1][cond2!=0]),na.rm=TRUE)
   # if(is.nan(Integr2)){
   #   Integr2 <- -10^6
   # }
@@ -88,7 +88,7 @@
     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)
+      assign(yuimaPPr at Ppr@counting.var[i], rep(1,length(dummyData)),envir=my.envd1)
     }
     # Names expression
     assign("NamesIntgra", NamesIntegrandExpr, envir=my.envd1)
@@ -101,10 +101,10 @@
         namedX<-c(namedX,paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx[i]))
         namedJumpTimeX <-c(namedJumpTimeX,paste0("JumpTime.d",yuimaPPr at Kernel@variable.Integral at var.dx[i]))
         dummyData <- diff(as.numeric(yuimaPPr at data@original.data[,cond]))# We consider only Jump
-        dummyJumpTime <- gridTime[-1][dummyData>0]
+        dummyJumpTime <- gridTime[-1][dummyData!=0]
         dummyData2 <- diff(unique(cumsum(dummyData)))
         #dummyData3 <- zoo(dummyData2,order.by = dummyJumpTime)
-        dummyData3 <- dummyData2
+        dummyData3 <- rep(1,length(dummyData2))
         JumpTime <- dummyJumpTime
         assign(paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx[i]), dummyData3 ,envir=my.envd1)
         assign(paste0("JumpTime.d",yuimaPPr at Kernel@variable.Integral at var.dx[i]), dummyJumpTime ,envir=my.envd1)
@@ -149,7 +149,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
-    dummyData <-yuimaPPr at data@original.data[,cond]
+    dummyData <-cumsum(c(as.numeric(yuimaPPr at data@original.data[1,cond]!=0),as.numeric(diff(yuimaPPr at data@original.data[,cond])!=0)))
     assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd3)
   }
   #time

Modified: pkg/yuima/R/simulateForPpr.R
===================================================================
--- pkg/yuima/R/simulateForPpr.R	2017-10-08 09:51:44 UTC (rev 629)
+++ pkg/yuima/R/simulateForPpr.R	2017-11-22 11:39:56 UTC (rev 630)
@@ -293,7 +293,7 @@
         }
 
         IntensityProc <- 0
-
+        #set.seed(1)
         dN<-0
 
         myhawkesP <- function(simMod, Kern,



More information about the Yuima-commits mailing list