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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 17 12:15:36 CEST 2010


Author: hinohide
Date: 2010-09-17 12:15:35 +0200 (Fri, 17 Sep 2010)
New Revision: 126

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/sim.euler.R
Log:
fixed a bug in sim.euler

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2010-08-18 11:53:17 UTC (rev 125)
+++ pkg/yuima/DESCRIPTION	2010-09-17 10:15:35 UTC (rev 126)
@@ -1,8 +1,8 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package (unstable version)
-Version: 0.1.15
-Date: 2010-08-18
+Version: 0.1.16
+Date: 2010-09-17
 Depends: methods, zoo, stats4, utils
 Suggests: cubature, mvtnorm
 Author: YUIMA Project Team.

Modified: pkg/yuima/R/sim.euler.R
===================================================================
--- pkg/yuima/R/sim.euler.R	2010-08-18 11:53:17 UTC (rev 125)
+++ pkg/yuima/R/sim.euler.R	2010-09-17 10:15:35 UTC (rev 126)
@@ -127,7 +127,13 @@
     }
     
     if(sdeModel at measure.type == "CP"){ ##:: Compound-Poisson type
-      eta0 <- eval(sdeModel at measure$intensity)
+
+      ##:: delete 2010/09/13 for simulate func bug fix by s.h
+            ## eta0 <- eval(sdeModel at measure$intensity)
+      
+      ##:: add 2010/09/13 for simulate func bug fix by s.h
+      eta0 <- eval(sdeModel at measure$intensity, env) ## intensity param
+
       ##:: get lambda from nu()
       lambda <- integrate(sdeModel at measure$df$func, 0, Inf)$value * eta0
       
@@ -152,7 +158,16 @@
       }else{
         stop("Sorry. CP only supports dexp, dnorm and dgamma yet.")
       }
-      randJ <- eval(F)  ## this expression is evaluated locally not in the yuimaEnv
+
+      ##:: delete 2010/09/13 for simulate func bug fix by s.h
+           ## randJ <- eval(F)  ## this expression is evaluated locally not in the yuimaEnv
+
+      ##:: add 2010/09/13 for simulate func bug fix by s.h
+      F.env <- new.env(parent=env)
+      assign("mu.size", mu.size, envir=F.env)
+      assign("N_sharp", N_sharp, envir=F.env)
+      randJ <- eval(F, F.env)  ## this expression is evaluated in the F.env
+      
       j <- 1
       for(i in 1:n){
         if(JAMP==FALSE || sum(i==ij)==0){



More information about the Yuima-commits mailing list