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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 20 20:22:32 CEST 2018


Author: lorenzo
Date: 2018-06-20 20:22:32 +0200 (Wed, 20 Jun 2018)
New Revision: 660

Modified:
   pkg/yuima/R/AuxMethodforPPR.R
   pkg/yuima/R/lambdaPPR.R
Log:
Improved computation Lambda

Modified: pkg/yuima/R/AuxMethodforPPR.R
===================================================================
--- pkg/yuima/R/AuxMethodforPPR.R	2018-06-20 14:54:53 UTC (rev 659)
+++ pkg/yuima/R/AuxMethodforPPR.R	2018-06-20 18:22:32 UTC (rev 660)
@@ -62,7 +62,7 @@
   
   #+sum((param-oldpar)^2*param^2)/2
   # line 40 necessary for the development of the cod
-  #cat("\n ",logLik, param)
+  cat("\n ",logLik, param)
   
   #assign("oldpar",param,envir = my.envd1)
   

Modified: pkg/yuima/R/lambdaPPR.R
===================================================================
--- pkg/yuima/R/lambdaPPR.R	2018-06-20 14:54:53 UTC (rev 659)
+++ pkg/yuima/R/lambdaPPR.R	2018-06-20 18:22:32 UTC (rev 660)
@@ -87,11 +87,12 @@
 
 
 InternalKernelFromPPRModel2<-function(Integrand2,Integrand2expr,my.envd1=NULL,my.envd2=NULL,
-                                      Univariate=TRUE, ExistdN, ExistdX, gridTime){
+                                      Univariate=TRUE, ExistdN, ExistdX, gridTime, dimCol, NameCol,
+                                      JumpTimeName){
   if(Univariate){
-    
-      dimCol<- dim(Integrand2)[2]
-      NameCol<-colnames(Integrand2)
+      # JumpTimeName  <- paste0("JumpTime.",NameCol[i])
+      # dimCol<- dim(Integrand2)[2]
+      # NameCol<-colnames(Integrand2)
       if(ExistdN){
         assign(my.envd1$t.time,gridTime, envir=my.envd1)
       }
@@ -107,7 +108,9 @@
         # since it is just univariate we don't need a cycle for
         if(ExistdN){  
           # cond <- paste0("JumpTime.",NameCol[i]) %in% my.envd1$namedJumpTimeX
-          cond <- my.envd1$namedJumpTimeX %in% paste0("JumpTime.",NameCol[i])
+          # cond <- my.envd1$namedJumpTimeX %in% paste0("JumpTime.",NameCol[i])
+          cond <- my.envd1$namedJumpTimeX %in% JumpTimeName[i]
+          
           if(any(cond)){
             assign(my.envd1$var.time,my.envd1[[my.envd1$namedJumpTimeX[cond]]],envir=my.envd1)
             # condpos <- NameCol %in% my.envd1$namedX
@@ -121,7 +124,8 @@
         
         if(ExistdX){  
           # cond <- paste0("JumpTime.",NameCol[i]) %in% my.envd2$namedJumpTimeX
-          cond <- my.envd2$namedJumpTimeX %in% paste0("JumpTime.",NameCol[i]) 
+          # cond <- my.envd2$namedJumpTimeX %in% paste0("JumpTime.",NameCol[i]) 
+          cond <- my.envd2$namedJumpTimeX %in% JumpTimeName[i]
           if(any(cond)){
             assign(my.envd2$var.time,my.envd2[[my.envd2$namedJumpTimeX[cond]]],envir=my.envd2)
             # condpos <- NameCol %in% my.envd2$namedX
@@ -198,10 +202,16 @@
     n.col <- length(gridTime)
     result <- matrix(NA,n.row, n.col) 
     Kernel<- numeric(length=n.col)
+    
+     dimCol<- dim(Integrand2)[2]
+     NameCol<-colnames(Integrand2)
+     JumpTimeName  <- paste0("JumpTime.",NameCol)
+    
     for(i in c(1:n.row)){
       Kernel <- sapply(X=gridTime,FUN = InternalKernelFromPPRModel2,
                        Integrand2=t(Integrand2[i,]), Integrand2expr = Integrand2expr[[i]],my.envd1=my.envd1,my.envd2=my.envd2,
-                       Univariate=TRUE, ExistdN =ExistdN, ExistdX=ExistdX )
+                       Univariate=TRUE, ExistdN =ExistdN, ExistdX=ExistdX, dimCol=dimCol, NameCol = NameCol,
+                       JumpTimeName =JumpTimeName)
       Evalgfun <- internalGfunFromPPRModel(gfun[i],my.envd3, univariate=TRUE)
       result[i,]<-Kernel+Evalgfun
     }



More information about the Yuima-commits mailing list