[Yuima-commits] r666 - in pkg/yuima: R src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 12 11:43:15 CEST 2018


Author: lorenzo
Date: 2018-07-12 11:43:15 +0200 (Thu, 12 Jul 2018)
New Revision: 666

Modified:
   pkg/yuima/R/RcppExports.R
   pkg/yuima/R/lambdaPPR.R
   pkg/yuima/src/IntensityEval.cpp
   pkg/yuima/src/RcppExports.cpp
   pkg/yuima/src/yuima_init.c
Log:
Updated PPR intensity code

Modified: pkg/yuima/R/RcppExports.R
===================================================================
--- pkg/yuima/R/RcppExports.R	2018-06-26 13:20:41 UTC (rev 665)
+++ pkg/yuima/R/RcppExports.R	2018-07-12 09:43:15 UTC (rev 666)
@@ -5,6 +5,10 @@
     .Call('yuima_evalKernelCpp', PACKAGE = 'yuima', Integrand2, Integrand2expr, myenvd1, myenvd2, ExistdN, ExistdX, gridTime, dimCol, NameCol, JumpTimeName)
 }
 
+evalKernelCpp2 <- function(Integrand2, Integrand2expr, myenvd1, myenvd2, CondIntensity, NameCountingVar, Namecovariates, ExistdN, ExistdX, gridTime, dimCol, NameCol, JumpTimeName) {
+    .Call('yuima_evalKernelCpp2', PACKAGE = 'yuima', Integrand2, Integrand2expr, myenvd1, myenvd2, CondIntensity, NameCountingVar, Namecovariates, ExistdN, ExistdX, gridTime, dimCol, NameCol, JumpTimeName)
+}
+
 W1 <- function(crossdx, b, A, h) {
     .Call('yuima_W1', PACKAGE = 'yuima', crossdx, b, A, h)
 }

Modified: pkg/yuima/R/lambdaPPR.R
===================================================================
--- pkg/yuima/R/lambdaPPR.R	2018-06-26 13:20:41 UTC (rev 665)
+++ pkg/yuima/R/lambdaPPR.R	2018-07-12 09:43:15 UTC (rev 666)
@@ -148,7 +148,88 @@
   return(IntegralKernel)
 }
 
+InternalKernelFromPPRModel3<-function(Integrand2,Integrand2expr,my.envd1=NULL,my.envd2=NULL,my.envd3=NULL,
+                                      Univariate=TRUE, ExistdN, ExistdX, gridTime, dimCol, NameCol,
+                                      JumpTimeName){
+  
+  if(Univariate){
+    # JumpTimeName  <- paste0("JumpTime.",NameCol[i])
+    # dimCol<- dim(Integrand2)[2]
+    # NameCol<-colnames(Integrand2)
+    if(ExistdN){
+      #assign(my.envd1$t.time,gridTime[1], envir=my.envd1)
+      my.envd1[[my.envd1$t.time]]<-gridTime[1]
+    }
+    if(ExistdX){
+      assign(my.envd2$t.time,gridTime[1], envir=my.envd2)
+    }
+    if(my.envd3$YUIMA.PPR at PPR@IntensWithCount){
+      for(i in c(1:length(my.envd3$YUIMA.PPR at PPR@counting.var))){
+        # assign(my.envd3$YUIMA.PPR at PPR@counting.var[i],
+        #   my.envd1[[my.envd1$PosListCountingVariable[i]]][[gridTime[2]]]
+        #   ,envir = my.envd1)
+        my.envd1[[my.envd3$YUIMA.PPR at PPR@counting.var[i]]]<-my.envd1[[my.envd1$PosListCountingVariable[i]]][[gridTime[2]]]
+      }
+      if(length(my.envd3$YUIMA.PPR at PPR@covariates)>0){
+        for(i in c(1:length(my.envd3$YUIMA.PPR at PPR@covariates))){
+          # assign(my.envd3$YUIMA.PPR at PPR@covariates[i],
+          #      my.envd1[[my.envd1$PosListCovariates[i]]][[gridTime[2]]]
+          #      ,envir = my.envd1)
+          my.envd1[[my.envd3$YUIMA.PPR at PPR@covariates[i]]]<-my.envd1[[my.envd1$PosListCovariates[i]]][[gridTime[2]]]
+        }
+      }
+    }
+    IntegralKernel<- 0
+    for(i in c(1:dimCol)){
+      
+      # cond <- NameCol[i] %in% my.envd1$NamesIntgra
+      # assign(my.envd1$var.time, time(my.envd1[[my.envd1$namedX[cond]]]), my.envd1)
+      # 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% JumpTimeName[i]
+        
+        if(any(cond)){
+          assign(my.envd1$var.time,my.envd1[[my.envd1$namedJumpTimeX[cond]]][[gridTime[2]]],envir=my.envd1)
+          # condpos <- NameCol %in% my.envd1$namedX
+          #condpos <- my.envd1$namedX %in% NameCol[i]  
+          condpos <- NameCol %in% NameCol[i]
+          if(any(condpos)){
+            InterDum <- eval(Integrand2expr[condpos], envir=my.envd1)*my.envd1[[NameCol[i]]][[gridTime[2]]]
+            IntegralKernelDum<- sum(InterDum,na.rm=TRUE)
+            IntegralKernel<-IntegralKernel+IntegralKernelDum
+          }
+        }
+      }
+      
+      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% JumpTimeName[i]
+        if(any(cond)){
+          #assign(my.envd2$var.time,my.envd2[[my.envd2$namedJumpTimeX[cond]]],envir=my.envd2)
+          assign(my.envd2$var.time,my.envd2[[my.envd2$namedJumpTimeX[cond]]][1:gridTime[2]],envir=my.envd2)
+          # condpos <- my.envd2$namedX %in% NameCol  
+          condpos <- NameCol %in% NameCol[i]
+          if(any(condpos)){
+            IntegralKernelDum<- sum(eval(Integrand2expr[condpos], envir=my.envd2)*my.envd2[[NameCol[i]]][1:gridTime[2]] , na.rm=TRUE)
+            IntegralKernel<-IntegralKernel+IntegralKernelDum
+          }
+        }
+      }
+      
+      
+    }
+    
+  }else{
+    return(NULL)
+  }
+  
+  return(IntegralKernel)
+}
 
+
 InternalConstractionIntensity2<-function(param,my.envd1=NULL,
                                          my.envd2=NULL,my.envd3=NULL){
   paramPPR <- my.envd3$YUIMA.PPR at PPR@allparamPPR
@@ -189,7 +270,7 @@
   #   KerneldN[i] <- InternalKernelFromPPRModel(Integrand2,Integrand2expr,my.envd1=my.envd1,my.envd2=my.envd2,
   #                                             Univariate=Univariate, ExistdN, ExistdX, gridTime=gridTime[i])
   # }
-  length(my.envd3$YUIMA.PPR at PPR@counting.var)
+  
   if(Univariate){
     Kernel<- numeric(length=length(gridTime))
     NameCol <- colnames(Integrand2)
@@ -199,10 +280,25 @@
     #                  dimCol=dim(Integrand2)[2], NameCol = NameCol,
     #                  JumpTimeName =paste0("JumpTime.",NameCol))
 
-    NameCol <- colnames(Integrand2)
-    Kernel <- evalKernelCpp(Integrand2, Integrand2expr,my.envd1, my.envd2,
-                            ExistdN, ExistdX, gridTime, dim(Integrand2)[2], NameCol,
-                            paste0("JumpTime.",NameCol))
+    # NameCol <- colnames(Integrand2)
+    # Kernel <- evalKernelCpp(Integrand2, Integrand2expr,my.envd1, my.envd2,
+    #                         ExistdN, ExistdX, gridTime, dim(Integrand2)[2], NameCol,
+    #                         paste0("JumpTime.",NameCol))
+    
+    # Kernel <- sapply(X=gridTime,FUN = InternalKernelFromPPRModel3,
+    #                  Integrand2=Integrand2, Integrand2expr = Integrand2expr,my.envd1=my.envd1,my.envd2=my.envd2,
+    #                  my.envd3=my.envd3,
+    #                  Univariate=Univariate, ExistdN =ExistdN, ExistdX=ExistdX,
+    #                  dimCol=dim(Integrand2)[2], NameCol = NameCol,
+    #                  JumpTimeName =paste0("JumpTime.",NameCol))
+    Kernel <- evalKernelCpp2(Integrand2,
+                      Integrand2expr,
+                      my.envd1, my.envd2, my.envd3$YUIMA.PPR at PPR@IntensWithCount,
+                      my.envd3$YUIMA.PPR at PPR@counting.var,
+                      my.envd3$YUIMA.PPR at PPR@covariates,
+                      ExistdN, ExistdX,
+                      gridTime, dimCol = dim(Integrand2)[2], NameCol = NameCol,
+                      JumpTimeName =paste0("JumpTime.",NameCol))
   #KerneldCov<- numeric(length=length(gridTime))
     Evalgfun <- internalGfunFromPPRModel(gfun,my.envd3, univariate=Univariate)
     result<-Kernel+Evalgfun
@@ -231,9 +327,16 @@
       #                   ExistdN =ExistdN, ExistdX=ExistdX,
       #                   dimCol=dimCol, NameCol = NameCol,
       #                   JumpTimeName =JumpTimeName)
-      Kernel <- evalKernelCpp(t(Integrand2[i,]), Integrand2expr[[i]],my.envd1, my.envd2,
-                     ExistdN, ExistdX, gridTime, dimCol, NameCol,
-                     JumpTimeName)
+      # Kernel <- evalKernelCpp(t(Integrand2[i,]), Integrand2expr[[i]],my.envd1, my.envd2,
+      #                ExistdN, ExistdX, gridTime, dimCol, NameCol,
+      #                JumpTimeName)
+      Kernel <- evalKernelCpp2(t(Integrand2[i,]), Integrand2expr[[i]],
+                               my.envd1, my.envd2, my.envd3$YUIMA.PPR at PPR@IntensWithCount, 
+                               my.envd3$YUIMA.PPR at PPR@counting.var,
+                               my.envd3$YUIMA.PPR at PPR@covariates,
+                               ExistdN, ExistdX,
+                               gridTime, dimCol = dim(Integrand2)[2], NameCol = NameCol,
+                               JumpTimeName =paste0("JumpTime.",NameCol))
       Evalgfun <- internalGfunFromPPRModel(gfun[i],my.envd3, univariate=TRUE)
       result[i,]<-Kernel+Evalgfun
     }
@@ -253,17 +356,18 @@
   dimIntegr <- length(yuimaPPR at Kernel@Integrand at IntegrandList)
   Integrand2 <- character(length=dimIntegr)
   for(i in c(1:dimIntegr)){
-    Integrand1 <- as.character(yuimaPPR at Kernel@Integrand at IntegrandList[[i]])
-    timeCond <- paste0(" * (",yuimaPPR at Kernel@variable.Integral at var.time," < ",yuimaPPR at Kernel@variable.Integral at upper.var,")")
-    Integrand2[i] <-paste0(Integrand1,timeCond)
+    #Integrand1 <- as.character(yuimaPPR at Kernel@Integrand at IntegrandList[[i]])
+    #timeCond <- paste0(" * (",yuimaPPR at Kernel@variable.Integral at var.time," < ",yuimaPPR at Kernel@variable.Integral at upper.var,")")
+    #Integrand2[i] <-paste0(Integrand1,timeCond)
+    Integrand2[i] <- as.character(yuimaPPR at Kernel@Integrand at IntegrandList[[i]])
   }
 
   Integrand2<- matrix(Integrand2,yuimaPPR at Kernel@Integrand at dimIntegrand[1],yuimaPPR at Kernel@Integrand at dimIntegrand[2])
 
 
-  for(j in c(1:yuimaPPR at Kernel@Integrand at dimIntegrand[2])){
-    Integrand2[,j]<-paste0(Integrand2[,j]," * d",yuimaPPR at Kernel@variable.Integral at var.dx[j])
-  }
+  # for(j in c(1:yuimaPPR at Kernel@Integrand at dimIntegrand[2])){
+  #   Integrand2[,j]<-paste0(Integrand2[,j]," * d",yuimaPPR at Kernel@variable.Integral at var.dx[j])
+  # }
   colnames(Integrand2) <- paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx)
   NamesIntegrandExpr <- as.character(matrix(colnames(Integrand2), dim(Integrand2)[1],dim(Integrand2)[2], byrow = TRUE))
   # if(yuimaPPR at Kernel@Integrand at dimIntegrand[2]==1 & yuimaPPR at Kernel@Integrand at dimIntegrand[1]==1)
@@ -274,7 +378,7 @@
   #   Integrand2expr <- parse(text=dum)
   # }
   if(yuimaPPR at Kernel@Integrand at dimIntegrand[1]==1){
-    Integrand2expr<- parse(text=Integrand2)
+    Integrand2expr <- parse(text=Integrand2)
   }else{
     Integrand2expr <- list()
     for(hh in c(1:yuimaPPR at Kernel@Integrand at dimIntegrand[1])){
@@ -336,8 +440,14 @@
         #dummyData3 <- zoo(dummyData2,order.by = dummyJumpTime)
         dummyData3 <- dummyData2
         JumpTime <- dummyJumpTime
-        assign(paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx[i]), as.numeric(dummyData3!=0) ,envir=my.envd1)
-        assign(paste0("JumpTime.d",yuimaPPR at Kernel@variable.Integral at var.dx[i]), dummyJumpTime ,envir=my.envd1)
+        Jump <- lapply(X=as.numeric(gridTime), FUN = function(X,JumpT,Jump){Jump[JumpT<X]},
+                       JumpT = dummyJumpTime, Jump = as.numeric(dummyData3!=0))
+        assign(paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx[i]), 
+               Jump ,
+               envir=my.envd1)
+        dummyJumpTimeNew <- lapply(X=as.numeric(gridTime), FUN = function(X,JumpT){JumpT[JumpT<X]},
+                                   JumpT = dummyJumpTime)
+        assign(paste0("JumpTime.d",yuimaPPR at Kernel@variable.Integral at var.dx[i]), dummyJumpTimeNew ,envir=my.envd1)
       }
     }
     assign("namedX",namedX, envir = my.envd1)
@@ -346,24 +456,38 @@
     assign("t.time",yuimaPPR at Kernel@variable.Integral at upper.var,envir=my.envd1)
 
     #CountingVariable
+    PosListCountingVariable <- NULL
     for(i in c(1:length(yuimaPPR at PPR@counting.var))){
       cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at PPR@counting.var[i]
-      condTime <- gridTime %in% my.envd1$JumpTime.dN
+      JUMPTIME <- tail(my.envd1[[paste0("JumpTime.d",yuimaPPR at Kernel@variable.Integral at var.dx[i])]],1L)[[1]]
+      condTime <- gridTime %in% JUMPTIME 
       
       dummyData <- yuimaPPR at data@original.data[condTime,cond]
-      assign(yuimaPPR at PPR@counting.var[i], as.numeric(dummyData),envir=my.envd1)
+      dummyDataA <- lapply(X=as.numeric(gridTime), FUN = function(X,JumpT,Jump){Jump[JumpT<X]},
+             JumpT = JUMPTIME, Jump = dummyData)
+      dummyList <- paste0("List_",yuimaPPR at PPR@counting.var[i])
+      PosListCountingVariable <- c(PosListCountingVariable,dummyList)
+      assign(dummyList, dummyDataA, envir=my.envd1)
+      assign(yuimaPPR at PPR@counting.var[i], numeric(length=0L), envir=my.envd1)
     }
-    
+    assign("PosListCountingVariable", PosListCountingVariable, envir=my.envd1)
     # Covariates
     if(length(yuimaPPR at PPR@covariates)>0){
       # Covariates should be identified at jump time
       # return(NULL)
+      PosListCovariates <- 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]
-        dummyData <-yuimaPPR at data@original.data[condTime, cond]
-        assign(yuimaPPR at PPR@covariates[i], dummyData,envir=my.envd1)
+        dummyData <- yuimaPPR at data@original.data[condTime, cond]
+        dummyDataB <- lapply(X=as.numeric(gridTime), FUN = function(X,JumpT,Jump){Jump[JumpT<X]},
+              JumpT = JUMPTIME, Jump = dummyData)
+        dummyListCov <- paste0("List_",yuimaPPR at PPR@covariates[i])
+        PosListCovariates <- c(PosListCovariates,dummyListCov)
+        assign(dummyListCov, dummyDataB,envir=my.envd1)
+        assign(yuimaPPR at PPR@covariates[i], numeric(length=0L),envir=my.envd1)
       }
+      assign("PosListCovariates", PosListCovariates,envir=my.envd1)
     }
 
   }
@@ -439,7 +563,11 @@
   assign("Integrand2",Integrand2,envir=my.envd3)
   assign("Integrand2expr",Integrand2expr,envir=my.envd3)
 
-  assign("gridTime",as.numeric(gridTime),envir=my.envd3)
+  l1 =as.list(as.numeric(gridTime))
+  l2 = as.list(c(1:(length(l1))))
+  l3 = mapply(c, l1, l2, SIMPLIFY=FALSE)
+  
+  assign("gridTime",l3,envir=my.envd3)
   assign("Univariate",Univariate,envir=my.envd3)
   assign("ExistdN",ExistdN,envir=my.envd3)
   assign("ExistdX",ExistdX,envir=my.envd3)

Modified: pkg/yuima/src/IntensityEval.cpp
===================================================================
--- pkg/yuima/src/IntensityEval.cpp	2018-06-26 13:20:41 UTC (rev 665)
+++ pkg/yuima/src/IntensityEval.cpp	2018-07-12 09:43:15 UTC (rev 666)
@@ -39,7 +39,7 @@
               SEXP X = Rf_eval( eval_call, myenvd1);
               NumericVector XX(X);
               NumericVector dumY = na_omit(XX);
-              IntegralKernel = IntegralKernel+sum(dumY);
+              IntegralKernel = IntegralKernel+sum(XX);
             }
           }
 /*
@@ -92,4 +92,101 @@
       GlobalKernel[t] = IntegralKernel;
   }
   return GlobalKernel;
+}
+// [[Rcpp::export]]
+NumericVector evalKernelCpp2(StringMatrix Integrand2, 
+                             ExpressionVector Integrand2expr, 
+                             Environment myenvd1, Environment myenvd2, LogicalVector CondIntensity,
+                             StringVector NameCountingVar,
+                             StringVector Namecovariates,
+                             LogicalVector ExistdN, LogicalVector ExistdX,
+                             List gridTime, IntegerVector dimCol,
+                             StringVector NameCol, StringVector JumpTimeName){
+  int FinT = gridTime.size()-1;
+  int lengtcov= Namecovariates.size();
+  NumericVector GlobalKernel(FinT);
+  for(int t=0;t<FinT;t++){
+    double IntegralKernel = 0;
+    if(ExistdN[0]){
+      String ttime = myenvd1.get("t.time");
+      NumericVector PosInTimedN = gridTime[t];
+      myenvd1.assign(ttime, PosInTimedN[0]);
+    }
+    if(CondIntensity[0]){
+      StringVector PosListCountingVariableC = myenvd1.get("PosListCountingVariable");
+      int dimCountingVar = NameCountingVar.size();
+      for(int i=0;i<dimCountingVar;i++){
+        String dummyStringListCount = as<std::string>(PosListCountingVariableC[i]);
+        List DummyListCount = myenvd1.get(dummyStringListCount);
+        String dummyStringCountN = as<std::string>(NameCountingVar[i]);
+        myenvd1.assign(dummyStringCountN,DummyListCount[t]);
+      }
+    }
+    if(lengtcov>0){
+      StringVector PosListCovariatesC = myenvd1.get("PosListCovariates");
+      for(int h=0;h<lengtcov;h++){
+        String dummyStringListcovariates = as<std::string>(PosListCovariatesC[h]);
+        List DummyListcovariates = myenvd1.get(dummyStringListcovariates);
+        String dummyStringcovariatesN = as<std::string>(Namecovariates[h]);
+        myenvd1.assign(dummyStringcovariatesN,DummyListcovariates[t]);
+      }
+    }
+    
+    for(int i=0;i<dimCol[0];i++){  
+      if(ExistdN[0]){
+        StringVector namedJumpTimeX1 = myenvd1.get("namedJumpTimeX"); 
+        StringVector namedX1 = myenvd1.get("namedX");
+        for(int j=0;j<namedJumpTimeX1.size();j++){
+          if(JumpTimeName[i]==namedJumpTimeX1[j]){
+            String dummyString = as<std::string>(JumpTimeName[i]);
+            List JumpTimeDiff = myenvd1.get(dummyString);
+            String vartime =myenvd1.get("var.time");
+            myenvd1.assign(vartime,JumpTimeDiff[t]);
+            String dumdN = NameCol[i];
+            List dNAll = myenvd1.get(dumdN);
+            NumericVector dN = dNAll[t];
+            if(dN.size()==0){
+              NumericVector dN[0] = 0;
+            }
+            Language eval_call( "eval", Integrand2expr[i], myenvd1);
+            SEXP X = Rf_eval( eval_call, myenvd1);
+            NumericVector XX(X);
+            NumericVector dumY = na_omit(XX);
+            double dumSumKer = 0;
+            for(int l=0;l<dumY.size();l++){
+              dumSumKer = dumSumKer + dumY[l]*dN[l];
+            }
+            IntegralKernel = IntegralKernel+dumSumKer;            
+          }
+        }
+      }
+      if(ExistdX[0]){
+        StringVector namedJumpTimeX2 = myenvd2.get("namedJumpTimeX");
+        for(int j=0;j<namedJumpTimeX2.size();j++){
+          if(JumpTimeName[i]==namedJumpTimeX2[j]){
+            String ttimedX = myenvd2.get("t.time");
+            NumericVector PosInTimedX = gridTime[t];
+            myenvd2.assign(ttimedX,PosInTimedX[0]);
+            String dummyString2 = as<std::string>(JumpTimeName[i]);
+            NumericVector JumpTime2 = myenvd2.get(dummyString2);
+            String vartime2 =myenvd2.get("var.time");
+            IntegerVector idx = seq(0,t);
+            myenvd2.assign(vartime2,JumpTime2[idx]);
+            Language eval_call( "eval", Integrand2expr[i], myenvd2);
+            SEXP X2 = Rf_eval( eval_call, myenvd2);
+            NumericVector XX2(X2);
+            
+            String dummyString3 = as<std::string>(NameCol[i]);
+            NumericVector dXdummy = myenvd2.get(dummyString3);
+            NumericVector dumY1 = XX2[idx]*dXdummy[idx];
+            NumericVector dumY2 = na_omit(dumY1);
+            IntegralKernel = IntegralKernel+sum(dumY2);
+            
+          }
+        }
+      }
+    }
+    GlobalKernel[t] = IntegralKernel;
+  }
+  return GlobalKernel;
 }
\ No newline at end of file

Modified: pkg/yuima/src/RcppExports.cpp
===================================================================
--- pkg/yuima/src/RcppExports.cpp	2018-06-26 13:20:41 UTC (rev 665)
+++ pkg/yuima/src/RcppExports.cpp	2018-07-12 09:43:15 UTC (rev 666)
@@ -26,6 +26,29 @@
     return rcpp_result_gen;
 END_RCPP
 }
+// evalKernelCpp2
+NumericVector evalKernelCpp2(StringMatrix Integrand2, ExpressionVector Integrand2expr, Environment myenvd1, Environment myenvd2, LogicalVector CondIntensity, StringVector NameCountingVar, StringVector Namecovariates, LogicalVector ExistdN, LogicalVector ExistdX, List gridTime, IntegerVector dimCol, StringVector NameCol, StringVector JumpTimeName);
+RcppExport SEXP _yuima_evalKernelCpp2(SEXP Integrand2SEXP, SEXP Integrand2exprSEXP, SEXP myenvd1SEXP, SEXP myenvd2SEXP, SEXP CondIntensitySEXP, SEXP NameCountingVarSEXP, SEXP NamecovariatesSEXP, SEXP ExistdNSEXP, SEXP ExistdXSEXP, SEXP gridTimeSEXP, SEXP dimColSEXP, SEXP NameColSEXP, SEXP JumpTimeNameSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< StringMatrix >::type Integrand2(Integrand2SEXP);
+    Rcpp::traits::input_parameter< ExpressionVector >::type Integrand2expr(Integrand2exprSEXP);
+    Rcpp::traits::input_parameter< Environment >::type myenvd1(myenvd1SEXP);
+    Rcpp::traits::input_parameter< Environment >::type myenvd2(myenvd2SEXP);
+    Rcpp::traits::input_parameter< LogicalVector >::type CondIntensity(CondIntensitySEXP);
+    Rcpp::traits::input_parameter< StringVector >::type NameCountingVar(NameCountingVarSEXP);
+    Rcpp::traits::input_parameter< StringVector >::type Namecovariates(NamecovariatesSEXP);
+    Rcpp::traits::input_parameter< LogicalVector >::type ExistdN(ExistdNSEXP);
+    Rcpp::traits::input_parameter< LogicalVector >::type ExistdX(ExistdXSEXP);
+    Rcpp::traits::input_parameter< List >::type gridTime(gridTimeSEXP);
+    Rcpp::traits::input_parameter< IntegerVector >::type dimCol(dimColSEXP);
+    Rcpp::traits::input_parameter< StringVector >::type NameCol(NameColSEXP);
+    Rcpp::traits::input_parameter< StringVector >::type JumpTimeName(JumpTimeNameSEXP);
+    rcpp_result_gen = Rcpp::wrap(evalKernelCpp2(Integrand2, Integrand2expr, myenvd1, myenvd2, CondIntensity, NameCountingVar, Namecovariates, ExistdN, ExistdX, gridTime, dimCol, NameCol, JumpTimeName));
+    return rcpp_result_gen;
+END_RCPP
+}
 // W1
 double W1(NumericMatrix crossdx, NumericMatrix b, NumericMatrix A, double h);
 RcppExport SEXP yuima_W1(SEXP crossdxSEXP, SEXP bSEXP, SEXP ASEXP, SEXP hSEXP) {
@@ -66,7 +89,7 @@
 }
 // makeprop
 NumericVector makeprop(NumericVector mu, NumericVector sample, NumericVector low, NumericVector up);
-RcppExport SEXP yuima_makeprop(SEXP muSEXP, SEXP sampleSEXP, SEXP lowSEXP, SEXP upSEXP) {
+RcppExport SEXP _yuima_makeprop(SEXP muSEXP, SEXP sampleSEXP, SEXP lowSEXP, SEXP upSEXP) {
 BEGIN_RCPP
     Rcpp::RObject rcpp_result_gen;
     Rcpp::RNGScope rcpp_rngScope_gen;
@@ -105,7 +128,7 @@
 }
 // detcpp
 double detcpp(NumericMatrix A);
-RcppExport SEXP yuima_detcpp(SEXP ASEXP) {
+RcppExport SEXP _yuima_detcpp(SEXP ASEXP) {
 BEGIN_RCPP
     Rcpp::RObject rcpp_result_gen;
     Rcpp::RNGScope rcpp_rngScope_gen;

Modified: pkg/yuima/src/yuima_init.c
===================================================================
--- pkg/yuima/src/yuima_init.c	2018-06-26 13:20:41 UTC (rev 665)
+++ pkg/yuima/src/yuima_init.c	2018-07-12 09:43:15 UTC (rev 666)
@@ -28,6 +28,7 @@
 /* .Call calls */
 extern SEXP yuima_detcpp(SEXP);
 extern SEXP yuima_evalKernelCpp(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
+extern SEXP yuima_evalKernelCpp2(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
 extern SEXP yuima_Irregular_PseudoLoglik_COG(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
 extern SEXP yuima_likndim(SEXP, SEXP, SEXP, SEXP);
 extern SEXP yuima_makeprop(SEXP, SEXP, SEXP, SEXP);
@@ -62,17 +63,18 @@
 };
 
 static const R_CallMethodDef CallEntries[] = {
-  {"yuima_detcpp",                      (DL_FUNC) &yuima_detcpp,                      1},
-  {"yuima_evalKernelCpp",               (DL_FUNC) &yuima_evalKernelCpp,              10},
-  {"yuima_Irregular_PseudoLoglik_COG",  (DL_FUNC) &yuima_Irregular_PseudoLoglik_COG, 15},
-  {"yuima_likndim",                     (DL_FUNC) &yuima_likndim,                     4},
-  {"yuima_makeprop",                    (DL_FUNC) &yuima_makeprop,                    4},
-  {"yuima_Smake",                       (DL_FUNC) &yuima_Smake,                       2},
-  {"yuima_solvecpp",                    (DL_FUNC) &yuima_solvecpp,                    1},
-  {"yuima_sqnorm",                      (DL_FUNC) &yuima_sqnorm,                      1},
-  {"yuima_sub_f",                       (DL_FUNC) &yuima_sub_f,                       2},
-  {"yuima_W1",                          (DL_FUNC) &yuima_W1,                          4},
-  {"yuima_W2",                          (DL_FUNC) &yuima_W2,                          3},
+  {"yuima_detcpp",                     (DL_FUNC) &yuima_detcpp,                      1},
+  {"yuima_evalKernelCpp",              (DL_FUNC) &yuima_evalKernelCpp,              10},
+  {"yuima_evalKernelCpp2",             (DL_FUNC) &yuima_evalKernelCpp2,             13},
+  {"yuima_Irregular_PseudoLoglik_COG", (DL_FUNC) &yuima_Irregular_PseudoLoglik_COG, 15},
+  {"yuima_likndim",                    (DL_FUNC) &yuima_likndim,                     4},
+  {"yuima_makeprop",                   (DL_FUNC) &yuima_makeprop,                    4},
+  {"yuima_Smake",                      (DL_FUNC) &yuima_Smake,                       2},
+  {"yuima_solvecpp",                   (DL_FUNC) &_yuima_solvecpp,                    1},
+  {"yuima_sqnorm",                     (DL_FUNC) &yuima_sqnorm,                      1},
+  {"yuima_sub_f",                      (DL_FUNC) &yuima_sub_f,                       2},
+  {"yuima_W1",                         (DL_FUNC) &yuima_W1,                          4},
+  {"yuima_W2",                         (DL_FUNC) &yuima_W2,                          3},
   {"Cycle_Carma",                       (DL_FUNC) &Cycle_Carma,                       12},
   {"euler",                             (DL_FUNC) &euler,                             11},
   {"pseudoLoglik_COGARCH1",             (DL_FUNC) &pseudoLoglik_COGARCH1,             14},



More information about the Yuima-commits mailing list