[Yuima-commits] r492 - in pkg/yuima: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 26 11:48:00 CEST 2016


Author: iacus
Date: 2016-10-26 11:47:59 +0200 (Wed, 26 Oct 2016)
New Revision: 492

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/sim.euler.R
Log:
fixed CP for initial!=0

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2016-10-26 08:55:23 UTC (rev 491)
+++ pkg/yuima/DESCRIPTION	2016-10-26 09:47:59 UTC (rev 492)
@@ -1,7 +1,7 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project Package for SDEs
-Version: 1.2.5
+Version: 1.2.6
 Depends: R(>= 2.10.0), methods, zoo, stats4, utils, expm, cubature, mvtnorm
 Imports: Rcpp (>= 0.12.1)
 Author: YUIMA Project Team

Modified: pkg/yuima/R/sim.euler.R
===================================================================
--- pkg/yuima/R/sim.euler.R	2016-10-26 08:55:23 UTC (rev 491)
+++ pkg/yuima/R/sim.euler.R	2016-10-26 09:47:59 UTC (rev 492)
@@ -9,6 +9,8 @@
 	r.size <- sdeModel at noise.number
 	d.size <- sdeModel at equation.number
 	Terminal <- yuima at sampling@Terminal[1]
+    Initial <- yuima at sampling@Initial[1]
+
 	n <- yuima at sampling@n[1]
 	dL <- env$dL
 
@@ -222,15 +224,18 @@
       lambda <- integrate(tmp.expr, -Inf, Inf)$value * eta0
 
       ##:: lambda = nu() (p6)
-      N_sharp <- rpois(1,Terminal*eta0)	##:: Po(Ne)
+      #     N_sharp <- rpois(1,Terminal*eta0)	##:: Po(Ne)
+      N_sharp <- rpois(1,(Terminal-Initial)*eta0)	##:: Po(Ne)
       if(N_sharp == 0){
         JAMP <- FALSE
       }else{
         JAMP <- TRUE
-        Uj <- sort( runif(N_sharp, 0, Terminal) )
+        Uj <- sort( runif(N_sharp, Initial, Terminal) )
+        #       Uj <- sort( runif(N_sharp, 0, Terminal) )
         ij <- NULL
         for(i in 1:length(Uj)){
-          Min <- min(which(c(1:n)*delta > Uj[i]))
+          Min <- min(which(Initial+ c(1:n)*delta > Uj[i]))
+          #         Min <- min(which(c(1:n)*delta > Uj[i]))
           ij <- c(ij, Min)
         }
       }



More information about the Yuima-commits mailing list