[Yuima-commits] r31 - in pkg/yuima: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 24 23:20:15 CET 2009


Author: iacus
Date: 2009-11-24 23:20:15 +0100 (Tue, 24 Nov 2009)
New Revision: 31

Modified:
   pkg/yuima/R/sim.euler.R
   pkg/yuima/R/simulate.R
   pkg/yuima/R/yuima.model.R
   pkg/yuima/man/setModel.Rd
   pkg/yuima/man/setSampling.Rd
   pkg/yuima/man/simulate.Rd
   pkg/yuima/man/yuima.sampling-class.Rd
Log:
now passes CMD CHECK

Modified: pkg/yuima/R/sim.euler.R
===================================================================
--- pkg/yuima/R/sim.euler.R	2009-11-24 18:32:20 UTC (rev 30)
+++ pkg/yuima/R/sim.euler.R	2009-11-24 22:20:15 UTC (rev 31)
@@ -152,7 +152,7 @@
       }else{
         stop("Sorry. CP only supports dexp, dnorm and dgamma yet.")
       }
-      randJ <- eval(F)
+		randJ <- eval(F)  ## this expression is evaluated locally not in the yuimaEnv
       j <- 1
       for(i in 1:division){
         if(JAMP==FALSE || sum(i==ij)==0){
@@ -162,7 +162,7 @@
           j <- j+1
           ##cat(paste(J,"\n"))
           ##Pi <- zeta(dX,J)
-          assign(sdeModel at jump.variable, J)
+          assign(sdeModel at jump.variable, J, env)
           ##Pi <- p.b.j(t=i*delta,X=dX) %*% J
           Pi <- p.b.j(t=i*delta, X=dX)
         }

Modified: pkg/yuima/R/simulate.R
===================================================================
--- pkg/yuima/R/simulate.R	2009-11-24 18:32:20 UTC (rev 30)
+++ pkg/yuima/R/simulate.R	2009-11-24 22:20:15 UTC (rev 31)
@@ -122,22 +122,22 @@
   }
 	
 	
-    
-  ##:: using Euler-Maruyama method
+##:: using Euler-Maruyama method
   delta <- Terminal/division 
 				
-				if (missing(increment.W)){
-					if (sdeModel at hurst!=1/2){ 
+
+				
+				if(missing(increment.W)){
+					if( sdeModel at hurst!=0.5 ){ 
 						grid<-sampling2grid(yuima at sampling)	
-						dW<-CholeskyfGn(grid,sdeModel at hurst)
-						dW <- t(matrix(dW, nrow=division, ncol=r.size))  
-					}else{
+						dW<-CholeskyfGn(grid, sdeModel at hurst)
+						dW <- t(matrix(dW, nrow=division, ncol=r.size))
+					} else {
 						delta<-Terminal/division
 						dW <- rnorm(division * r.size, 0, sqrt(delta))
 						dW <- t(matrix(dW, nrow=division, ncol=r.size))  
 					}
-					
-				}else{
+				} else {
 					dW <- increment.W
 				}
 				

Modified: pkg/yuima/R/yuima.model.R
===================================================================
--- pkg/yuima/R/yuima.model.R	2009-11-24 18:32:20 UTC (rev 30)
+++ pkg/yuima/R/yuima.model.R	2009-11-24 22:20:15 UTC (rev 31)
@@ -55,7 +55,7 @@
 ## set yuima model from SDE
 setModel <- function(drift=NULL,
                      diffusion=NULL,
-					 hurst=as.numeric(NULL),
+hurst=0.5, # as.numeric(NULL),
                      jump.coeff=character(),
                      measure=list(),
                      measure.type=character(),

Modified: pkg/yuima/man/setModel.Rd
===================================================================
--- pkg/yuima/man/setModel.Rd	2009-11-24 18:32:20 UTC (rev 30)
+++ pkg/yuima/man/setModel.Rd	2009-11-24 22:20:15 UTC (rev 31)
@@ -16,7 +16,7 @@
 }
 
 \usage{
-setModel(drift=NULL, diffusion=NULL, jump.coeff=character(),
+setModel(drift=NULL, diffusion=NULL, hurst = 0.5, jump.coeff=character(),
 measure=list(), measure.type=character(), state.variable="x",
 jump.variable="z", time.variable="t", solve.variable, xinit)
 }
@@ -24,6 +24,9 @@
 \arguments{
   \item{drift}{a vector of \code{expression}s (the default value is 0).}
   \item{diffusion}{a matrix of \code{expression}s (the default value is 1).}
+  \item{hurst}{the hurst parameter of the gaussian noise. If \code{h=0.5}, the default,
+  the process is Wiener otherwise it is fractional Brownian motion with that precise value
+   of the hurst index.}
   \item{jump.coeff}{a matrix of \code{expression}x.}
   \item{measure}{Levy measure for jump variables.}
   \item{measure.type}{Type specification for Levy measures.}

Modified: pkg/yuima/man/setSampling.Rd
===================================================================
--- pkg/yuima/man/setSampling.Rd	2009-11-24 18:32:20 UTC (rev 30)
+++ pkg/yuima/man/setSampling.Rd	2009-11-24 22:20:15 UTC (rev 31)
@@ -8,12 +8,15 @@
   \code{setSampling} is a constructor for \code{sampling} class.
 }
 \usage{
-  setSampling(Terminal,division)
+  setSampling(Terminal, division, Initial=0, grid=as.numeric(NULL), random=FALSE)
 }
 \arguments{  
   %%\item{x}{an object of class \code{yuima}, \code{yuima.model} or \code{yuima.data}}
   \item{Terminal}{Terminal}
   \item{division}{division}
+  \item{Initial}{Initial}
+  \item{grid}{a grid of times for the simulation, possibly empty}
+  \item{random}{specify if it is erandom sampling}
 }
 \details{
   class \code{sampling} has two slots,

Modified: pkg/yuima/man/simulate.Rd
===================================================================
--- pkg/yuima/man/simulate.Rd	2009-11-24 18:32:20 UTC (rev 30)
+++ pkg/yuima/man/simulate.Rd	2009-11-24 22:20:15 UTC (rev 31)
@@ -3,7 +3,7 @@
 \title{Simulator function for multi-dimensional stochastic processes}
 \description{Simulate multi-dimensional stochastic processes.}
 \usage{
-simulate(yuima, nsim, seed, xinit, true.parameter, space.discretized, increment.W, increment.L)
+simulate(object, nsim, seed, xinit, true.parameter, space.discretized, increment.W, increment.L)
 }
 \arguments{
   \item{object}{an \code{yuima} object.}

Modified: pkg/yuima/man/yuima.sampling-class.Rd
===================================================================
--- pkg/yuima/man/yuima.sampling-class.Rd	2009-11-24 18:32:20 UTC (rev 30)
+++ pkg/yuima/man/yuima.sampling-class.Rd	2009-11-24 22:20:15 UTC (rev 31)
@@ -10,6 +10,9 @@
   \describe{
     \item{\code{Terminal}:}{Horizon of the stochastic processes.}
     \item{\code{division}:}{Time division for the data and/or model.}
+    \item{\code{Initial}:}{Initial time of the data and/or model.}
+    \item{\code{grid}:}{a grid of time points on which data are simulated.}
+    \item{\code{random}:}{whether simulation consists of random times.}
   }
 }
 \author{YUIMA Project}



More information about the Yuima-commits mailing list