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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 20 11:29:27 CET 2009


Author: iacus
Date: 2009-12-20 11:29:27 +0100 (Sun, 20 Dec 2009)
New Revision: 48

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/AllClasses.R
   pkg/yuima/R/poisson.random.sampling.R
   pkg/yuima/R/quasi-likelihood.R
   pkg/yuima/R/sampling2grid.R
   pkg/yuima/R/sim.euler.R
   pkg/yuima/R/sim.euler.space.discretized.R
   pkg/yuima/R/simulate.R
   pkg/yuima/R/yuima.R
   pkg/yuima/R/yuima.sampling.R
   pkg/yuima/man/adaBayes.Rd
   pkg/yuima/man/cce.Rd
   pkg/yuima/man/limiting.gamma.Rd
   pkg/yuima/man/model.parameter-class.Rd
   pkg/yuima/man/poisson.random.sampling.Rd
   pkg/yuima/man/quasi-likelihood.Rd
   pkg/yuima/man/setData.Rd
   pkg/yuima/man/setModel.Rd
   pkg/yuima/man/setSampling.Rd
   pkg/yuima/man/setYuima.Rd
   pkg/yuima/man/simulate.Rd
   pkg/yuima/man/yuima.data-class.Rd
   pkg/yuima/man/yuima.sampling-class.Rd
Log:
small update to man pages and changed division with n

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/DESCRIPTION	2009-12-20 10:29:27 UTC (rev 48)
@@ -1,13 +1,12 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package
-Version: 0.0.78
-Date: 2009-12-18
+Version: 0.0.79
+Date: 2009-12-20
 Depends: methods, zoo
 Author: YUIMA Project Team.
 Maintainer: Stefano M. Iacus <stefano.iacus at R-project.org>
-Description: The YUIMA Project for Simulation and Inference of 
- Multidimensional Stochastic Differential Equations driven by
- with Abstract Noise. 
+Description: The YUIMA Project for Simulation and Inference 
+ for Stochastic Differential Equations.
 License: GPL-2
 URL: http://R-Forge.R-project.org/projects/yuima/

Modified: pkg/yuima/R/AllClasses.R
===================================================================
--- pkg/yuima/R/AllClasses.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/AllClasses.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -54,7 +54,7 @@
 
 setClass("yuima.sampling", representation(Initial  = "numeric",
 										  Terminal = "numeric",
-                                          division = "numeric",
+                                          n = "numeric",
 										  delta    = "numeric",
 										  grid     = "numeric",
 										  random   = "ANY",

Modified: pkg/yuima/R/poisson.random.sampling.R
===================================================================
--- pkg/yuima/R/poisson.random.sampling.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/poisson.random.sampling.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -32,7 +32,7 @@
               }
               
               ## making time index
-              # get rid of first element of X and elements that over division
+              # get rid of first element of X and elements that over n
               # round Time to unit
               xTime<-trunc(Time[0<Time & Num>Time])
               # get rid of elements of value = 0

Modified: pkg/yuima/R/quasi-likelihood.R
===================================================================
--- pkg/yuima/R/quasi-likelihood.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/quasi-likelihood.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -8,13 +8,13 @@
   modelstate <- yuima at model@state.variable
   modelpara <- yuima at model@parameter at drift
   DRIFT <- yuima at model@drift
-  division <- length(yuima)[1]
-  drift <- matrix(0,division,d.size)
+  n <- length(yuima)[1]
+  drift <- matrix(0,n,d.size)
   X <- as.matrix(onezoo(yuima))
   for(i in 1:length(modelpara)){
     assign(modelpara[i],para[i])
   }
-  for(t in 1:division){
+  for(t in 1:n){
     Xt <- X[t,]
     for(d in 1:d.size){
       assign(modelstate[d],Xt[d])
@@ -35,14 +35,14 @@
   modelstate <- yuima at model@state.variable
   modelpara <- yuima at model@parameter at diffusion
   DIFFUSION <- yuima at model@diffusion
-  division <- length(yuima)[1]
-  diff <- array(0, dim=c(d.size, r.size, division))
+  n <- length(yuima)[1]
+  diff <- array(0, dim=c(d.size, r.size, n))
   X <- as.matrix(onezoo(yuima))
   for(k in 1:length(modelpara)){
     assign(modelpara[k], para[k])
   }
   for(r in 1:r.size){
-    for(t in 1:division){
+    for(t in 1:n){
       Xt <- X[t, ]
       for(d in 1:d.size){
         assign(modelstate[d], Xt[d])
@@ -58,9 +58,9 @@
 ##::calcurate diffusion%*%t(diffusion) matrix
 calc.B <- function(diff){
   d.size <- dim(diff)[1]
-  division <- dim(diff)[3]
-  B <- array(0, dim=c(d.size, d.size, division))
-  for(t in 1:division){
+  n <- dim(diff)[3]
+  B <- array(0, dim=c(d.size, d.size, n))
+  for(t in 1:n){
     B[, , t] <- diff[, , t]%*%t(diff[, , t])
   }
   return(B)
@@ -72,7 +72,7 @@
   modelstate <- yuima at model@state.variable
   modelpara <- yuima at model@parameter at diffusion
   DIFFUSION <- yuima at model@diffusion
-  division <- length(yuima)[1]
+  n <- length(yuima)[1]
   X <- as.matrix(onezoo(yuima))
   
   for(k in 1:length(modelpara)){
@@ -93,9 +93,9 @@
   ##     }
   ##   }
   
-  B.grad <- array(0, dim=c(d.size, d.size, division, length(modelpara)))
+  B.grad <- array(0, dim=c(d.size, d.size, n, length(modelpara)))
   for(k in 1:length(modelpara)){
-    for(t in 1:division){
+    for(t in 1:n){
       for(d in 1:d.size){
         assign(modelstate[d], X[t, d])
       }
@@ -193,12 +193,20 @@
             }
             
             d.size <- yuima at model@equation.number
-            division <- length(yuima)[1]
+            n <- length(yuima)[1]
             X <- as.matrix(onezoo(yuima))
-            deltaX <- matrix(0, division-1, d.size)
-            for(t in 1:(division-1)){
-              deltaX[t, ] <- X[t+1, ]-X[t, ]
-            }
+            deltaX <- matrix(0, n-1, d.size)
+			for(t in 1:(n-1))
+			 deltaX[t, ] <- X[t+1, ]-X[t, ]
+			
+#		  
+#			  print(system.time(for(t in 1:(n-1))
+#              deltaX[t, ] <- X[t+1, ]-X[t, ]
+#            ))
+#			print(system.time(deltaX1 <- diff(X)))
+#				  print(deltaX)
+#				  print(deltaX1)
+				  
             if(is.nan(theta2) || is.nan(theta1)){
               stop("error: theta is not a namber in parameter matrix")
             }
@@ -207,8 +215,8 @@
             B <- calc.B(diff)
             
             QL <- 0
-            pn <- numeric(division-1)
-            for(t in 1:(division-1)){
+            pn <- numeric(n-1)
+            for(t in 1:(n-1)){
               if(det(as.matrix(B[, , t]))==0){
                 pn[t] <- log(1)
               }else{
@@ -257,10 +265,10 @@
   }
   
   d.size <- yuima at model@equation.number
-  division <- length(yuima)[1]
+  n <- length(yuima)[1]
   X <- as.matrix(onezoo(yuima))
-  deltaX <- matrix(0, division-1, d.size)
-  for(t in 1:(division-1)){
+  deltaX <- matrix(0, n-1, d.size)
+  for(t in 1:(n-1)){
     deltaX[t, ] <- X[t+1, ]-X[t, ]
   }
   if(is.nan(theta2) || is.nan(theta1)){
@@ -275,7 +283,7 @@
   for(k in 1:length(QLG)){
     pg1 <- 0
     pg2 <- 0
-    for(t in 1:(division-1)){
+    for(t in 1:(n-1)){
       B.tmp <- as.matrix(B[, , t])
       if(det(B.tmp)!=0){
         B.grad.tmp <- as.matrix(B.grad[, , t, k])
@@ -413,10 +421,10 @@
             }
             
             d.size <- yuima at model@equation.number
-            division <- length(yuima)[1]
+            n <- length(yuima)[1]
             X <- as.matrix(onezoo(yuima))
-            deltaX <- matrix(0, division-1, d.size)
-            for(t in 1:(division-1)){
+            deltaX <- matrix(0, n-1, d.size)
+            for(t in 1:(n-1)){
               deltaX[t, ] <- X[t+1, ]-X[t, ]
             }
             if(is.nan(theta2) || is.nan(theta1)){
@@ -431,8 +439,8 @@
             pB <- calc.B(pdiff)
             
             rQL <- 0
-            pn <- numeric(division-1)
-            for(t in 1:(division-1)){
+            pn <- numeric(n-1)
+            for(t in 1:(n-1)){
               if(det(as.matrix(B[, , t]))*det(as.matrix(pB[, , t]))==0){
                 pn[t] <- log(1)
               }else{

Modified: pkg/yuima/R/sampling2grid.R
===================================================================
--- pkg/yuima/R/sampling2grid.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/sampling2grid.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -11,7 +11,7 @@
 #Check if this grid is random	
 	if (samp at random==FALSE){			
 #Regular deterministic grid 
-		return(seq(samp at Initial[1],samp at Terminal[1],length=samp at division[1]+1)) #Attention! do not treat multifrequency grid
+		return(seq(samp at Initial[1],samp at Terminal[1],length=samp at n[1]+1)) #Attention! do not treat multifrequency grid
 	}
 	
 	return(1) #To do: Random grid		

Modified: pkg/yuima/R/sim.euler.R
===================================================================
--- pkg/yuima/R/sim.euler.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/sim.euler.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -10,12 +10,12 @@
 	r.size <- sdeModel at noise.number
 	d.size <- sdeModel at equation.number
 	Terminal <- yuima at sampling@Terminal[1]
-	division <- yuima at sampling@division[1]
+	n <- yuima at sampling@n[1]
 	
 	dX <- xinit
 	
 ##:: set time step	
-	delta <- Terminal/division 
+	delta <- Terminal/n 
 	
 ##:: check if DRIFT and/or DIFFUSION has values
 	has.drift <- sum(as.character(sdeModel at drift) != "(0)")
@@ -49,11 +49,11 @@
     return(tmp)
   }
   
-  X_mat <- matrix(0, d.size, division+1)
+  X_mat <- matrix(0, d.size, n+1)
   X_mat[,1] <- dX
   
 	if(has.drift){  ##:: consider drift term to be one of the diffusion term(dW=1) 
-		dW <- rbind( rep(1, division)*delta , dW)
+		dW <- rbind( rep(1, n)*delta , dW)
 	}
 	
   
@@ -62,12 +62,12 @@
         
     if(var.in.diff){  ##:: diffusions have state variables
       ##:: calcurate difference eq.    
-      for( i in 1:division){
+      for( i in 1:n){
         dX <- dX + p.b(t=i*delta, X=dX) %*% dW[, i]
         X_mat[,i+1] <- dX
       }
     }else{  ##:: diffusions have no state variables (not use p.b(). faster)
-      sde.tics <- seq(0, Terminal, length=(division+1))
+      sde.tics <- seq(0, Terminal, length=(n+1))
       sde.tics <- sde.tics[2:length(sde.tics)]
       
       X_mat[, 1] <- dX
@@ -102,7 +102,7 @@
       pbdata <- t(pbdata)
       
       ##:: calcurate difference eq.
-      for( i in 1:division){
+      for( i in 1:n){
         dX <- dX + pbdata[((i-1)*d.size+1):(i*d.size), ] %*% dW[, i]
         X_mat[, i+1] <- dX
       }
@@ -140,7 +140,7 @@
         Uj <- sort( runif(N_sharp, 0, Terminal) )
         ij <- NULL
         for(i in 1:length(Uj)){
-          Min <- min(which(c(1:division)*delta > Uj[i]))
+          Min <- min(which(c(1:n)*delta > Uj[i]))
           ij <- c(ij, Min)
         }
       }
@@ -154,7 +154,7 @@
       }
       randJ <- eval(F)  ## this expression is evaluated locally not in the yuimaEnv
       j <- 1
-      for(i in 1:division){
+      for(i in 1:n){
         if(JAMP==FALSE || sum(i==ij)==0){
           Pi <- 0
         }else{
@@ -181,14 +181,14 @@
       code <- suppressWarnings(sub("^(.+?)\\(.+", "\\1", sdeModel at measure$df$expr, perl=TRUE))
       args <- unlist(strsplit(suppressWarnings(sub("^.+?\\((.+)\\)", "\\1", sdeModel at measure$df$expr, perl=TRUE)), ","))
       dZ <- switch(code,
-                   rNIG=paste("rNIG(division, ", args[2], ", ", args[3], ", ", args[4], "*delta, ", args[5], "*delta)"),
-                   rIG=paste("rIG(division,", args[2], "*delta, ", args[3], ")"),
-                   rgamma=paste("rgamma(division, ", args[2], "*delta, ", args[3], ")"),
-                   rbgamma=paste("rbgamma(division, ", args[2], "*delta, ", args[3], ", ", args[4], "*delta, ", args[5], ")"),
-##                   rngamma=paste("rngamma(division, ", args[2], "*delta, ", args[3], ", ", args[4], ", ", args[5], "*delta, ", args[6], ")"),
-                   rngamma=paste("rngamma(division, ", args[2], "*delta, ", args[3], ", ", args[4], ", ", args[5], "*delta)"),
-##                   rstable=paste("rstable(division, ", args[2], ", ", args[3], ", ", args[4], ", ", args[5], ", ", args[6], ")")
-                   rstable=paste("rstable(division, ", args[2], ", ", args[3], ", ", args[4], "*delta^(1/",args[2],"), ", args[5], "*delta)")
+                   rNIG=paste("rNIG(n, ", args[2], ", ", args[3], ", ", args[4], "*delta, ", args[5], "*delta)"),
+                   rIG=paste("rIG(n,", args[2], "*delta, ", args[3], ")"),
+                   rgamma=paste("rgamma(n, ", args[2], "*delta, ", args[3], ")"),
+                   rbgamma=paste("rbgamma(n, ", args[2], "*delta, ", args[3], ", ", args[4], "*delta, ", args[5], ")"),
+##                   rngamma=paste("rngamma(n, ", args[2], "*delta, ", args[3], ", ", args[4], ", ", args[5], "*delta, ", args[6], ")"),
+                   rngamma=paste("rngamma(n, ", args[2], "*delta, ", args[3], ", ", args[4], ", ", args[5], "*delta)"),
+##                   rstable=paste("rstable(n, ", args[2], ", ", args[3], ", ", args[4], ", ", args[5], ", ", args[6], ")")
+                   rstable=paste("rstable(n, ", args[2], ", ", args[3], ", ", args[4], "*delta^(1/",args[2],"), ", args[5], "*delta)")
                    )
       
       if(is.null(dZ)){  ##:: "otherwise"
@@ -198,7 +198,7 @@
       dZ <- eval(parse(text=dZ))
       ##:: calcurate difference eq.
       
-      for(i in 1:division){
+      for(i in 1:n){
         assign(sdeModel at jump.variable, dZ[i], env)
         
         if(sdeModel at J.flag){

Modified: pkg/yuima/R/sim.euler.space.discretized.R
===================================================================
--- pkg/yuima/R/sim.euler.space.discretized.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/sim.euler.space.discretized.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -11,11 +11,11 @@
 	r.size <- sdeModel at noise.number
 	d.size <- sdeModel at equation.number
 	Terminal <- yuima at sampling@Terminal[1]
-	division <- yuima at sampling@division[1]
+	n <- yuima at sampling@n[1]
 	dX <- xinit
 	
 ##:: set time step	
-	delta <- Terminal/division 
+	delta <- Terminal/n 
 
 	
 	
@@ -54,7 +54,7 @@
     appfunc <- suppressWarnings(approxfun(gg, xx))
     
     ##:: calculate inverse of G
-    unif.a <- runif(division*2)
+    unif.a <- runif(n*2)
     inv.a <- pmin(qnorm(1 - unif.a/4), appfunc(unif.a), na.rm=TRUE)
     
     ##:: make random time steps

Modified: pkg/yuima/R/simulate.R
===================================================================
--- pkg/yuima/R/simulate.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/simulate.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -30,7 +30,7 @@
   
 				sdeModel <- yuima at model
 				Terminal <- yuima at sampling@Terminal[1]
-				division <- yuima at sampling@division[1]
+				n <- yuima at sampling@n[1]
 				r.size <- sdeModel at noise.number
 				d.size <- sdeModel at equation.number				
 				
@@ -47,12 +47,8 @@
 				}
 				
 
-  
-  ##   str(sdeModel)
-  ##   print(Terminal)
-  ##   print(yuima at sampling@division)
-  ##   readline()
-  
+
+				
   par.len <- length(sdeModel at parameter@all)
 				
   if(missing(true.parameter) & par.len>0){
@@ -91,8 +87,8 @@
     }else if(dim(increment.W)[1] != r.size){
       cat("\nLength of increment's row must be same as yuima at model@noise.number.\n")
       return(NULL)
-    }else if(dim(increment.W)[2] != division){
-      cat("\nLength of increment's column must be same as yuima at sampling@division[1].\n")
+    }else if(dim(increment.W)[2] != n){
+      cat("\nLength of increment's column must be same as yuima at sampling@n[1].\n")
       return(NULL)
     }
   }
@@ -105,8 +101,8 @@
     }else if(dim(increment.L)[1] != r.size){
       cat("\nLength of increment's row must be same as yuima at model@noise.number.\n")
       return(NULL)
-    }else if(dim(increment.L)[2] != division){
-      cat("\nLength of increment's column must be same as yuima at sampling@division[1].\n")
+    }else if(dim(increment.L)[2] != n){
+      cat("\nLength of increment's column must be same as yuima at sampling@n[1].\n")
       return(NULL)
     }
   }
@@ -123,7 +119,7 @@
 	
 	
 ##:: using Euler-Maruyama method
-  delta <- Terminal/division 
+  delta <- Terminal/n 
 				
 
 				
@@ -139,9 +135,9 @@
 						}
 						
 					} else {
-						delta<-Terminal/division
-						dW <- rnorm(division * r.size, 0, sqrt(delta))
-						dW <- matrix(dW, ncol=division, nrow=r.size,byrow=TRUE)  
+						delta<-Terminal/n
+						dW <- rnorm(n * r.size, 0, sqrt(delta))
+						dW <- matrix(dW, ncol=n, nrow=r.size,byrow=TRUE)  
 					}
 				} else {
 					dW <- increment.W

Modified: pkg/yuima/R/yuima.R
===================================================================
--- pkg/yuima/R/yuima.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/yuima.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -29,7 +29,7 @@
                 if(eqn!=length(sampling at Terminal)){
                   if(length(sampling at Terminal)==1){
                     sampling at Terminal <- rep(sampling at Terminal, eqn)
-                    sampling at division <- rep(sampling at division, eqn)
+                    sampling at n <- rep(sampling at n, eqn)
                   }else{
                     cat("\nSampling's equation number missmatch.\n")
                     return(NULL)

Modified: pkg/yuima/R/yuima.sampling.R
===================================================================
--- pkg/yuima/R/yuima.sampling.R	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/R/yuima.sampling.R	2009-12-20 10:29:27 UTC (rev 48)
@@ -5,14 +5,14 @@
 
  
 setMethod("initialize", "yuima.sampling",
-           function(.Object, Initial, Terminal, division, delta, grid, random, 
+           function(.Object, Initial, Terminal, n, delta, grid, random, 
 				 scale, regular){  
                .Object at scale <- 1
 			   if(length(grid)>0){
 				   
 				   testInitial<-(min(grid)==Initial)
 				   testTerminal<-(max(grid)==Terminal)
-				   testdivision<-(abs(division-diff(range(grid))/mean(diff(grid))+1)<10^(-10))
+				   testn<-(abs(n-diff(range(grid))/mean(diff(grid))+1)<10^(-10))
 				   testdelta<-(abs(delta-mean(diff(grid)))<10^(-10))
 				   testregular<-all(abs(diff(diff(grid)))<10^(-10))
 				   
@@ -22,18 +22,18 @@
 				   if(!testTerminal){
 					   cat("\n Terminal time has been set with the grid \n")
 				   }
-				   if(!testdivision){
+				   if(!testn){
 					   cat("\n Division has been set with the grid \n")
 				   }
 				   if(!testdelta){
 					   cat("\n delta has been set with the grid \n")
 				   }
 				   if(testregular){
-				.Object at division <- diff(range(grid))/mean(diff(grid))+1
+				.Object at n <- diff(range(grid))/mean(diff(grid))+1
 				.Object at delta    <- mean(diff(grid))
 			    .Object at regular  <- TRUE
 			       }else{
-			    .Object at division <- length(grid)-1
+			    .Object at n <- length(grid)-1
 			    .Object at delta    <- as.numeric(NULL)
 			    .Object at regular  <- FALSE  
 				   }
@@ -44,26 +44,26 @@
 			   }else{ 
 			 # There is no grid
 			 eqn <- length(Terminal)
-             if(length(Terminal)==length(division)){
+             if(length(Terminal)==length(n)){
                .Object at Initial  <- Initial
 			   .Object at Terminal <- Terminal
-               .Object at division <- division
+               .Object at n <- n
 			   .Object at delta    <- delta
 			   .Object at grid     <- grid
 			   .Object at random   <- random
 			   .Object at regular  <- regular
              }else if(length(Terminal)==1){               
                .Object at Initial  <- Initial
-			   .Object at Terminal <- rep(Terminal, length(division))
-			   .Object at division <- division	 
+			   .Object at Terminal <- rep(Terminal, length(n))
+			   .Object at n <- n	 
 			   .Object at delta    <- delta
 			   .Object at grid     <- grid
 			   .Object at random   <- random
 			   .Object at regular  <- regular	 
-             }else if(length(division)==1){
+             }else if(length(n)==1){
                .Object at Initial  <- Initial
 			   .Object at Terminal <- Terminal
-               .Object at division <- rep(division, length(Terminal))
+               .Object at n <- rep(n, length(Terminal))
 			   .Object at delta    <- delta
 			   .Object at grid     <- grid
 			   .Object at random   <- random
@@ -75,72 +75,10 @@
              return(.Object)
            })
 
-setSampling <- function(Initial=0, Terminal=1, division=100, delta=0.1, 
+setSampling <- function(Initial=0, Terminal=1, n=100, delta=0.1, 
  grid=as.numeric(NULL), random=FALSE, scale=1){
   return(new("yuima.sampling", Initial=Initial, Terminal=Terminal, 
-	division=division, delta=delta, grid=grid, random=random, 
+	n=n, delta=delta, grid=grid, random=random, 
 			 scale=scale, regular=TRUE))
 }
 
-# accessors
-## setGeneric("setSampling",
-##            function(x,Terminal,division)
-##            standardGeneric("setSampling")
-##            )
-
-## setMethod("setSampling", signature(x="yuima.model"),
-##           function(x,Terminal=1,division=100){
-##             if(length(x at equation.number) == 0) {
-##               cat("model is empty!\n")
-##               return(NULL)
-##             }
-##             d.size <- x at equation.number
-##             if(length(Terminal)==1) {
-##               Terminal <- rep(Terminal,d.size)
-##             }
-##             if(length(division)==1) {
-##               division <- rep(division,d.size)
-##             }
-##             if(length(Terminal)!=d.size) {
-##               cat("length of Terminal is not matched with model!\n")
-##               return(NULL)
-##             }
-##             if(length(division)!=d.size) {
-##               cat("length of division is not matched with model!\n")
-##               return(NULL)
-##             }
-##             return(new("yuima.sampling", Terminal=Terminal, division=division ))
-##           })
-
-## setMethod("setSampling", signature(x="yuima.data"),
-##           function(x,Terminal=1,division=100){
-## 		    d.size <- dim(get.zoo.data(x))[2]
-## 		    if(is.null(d.size)) {
-## 			  cat("data is empty!\n")
-## 			  return(NULL)
-## 			}
-			
-## 			if(length(Terminal)==1) {
-## 			  Terminal <- rep(Terminal,d.size)
-## 			}
-## 			if(length(division)==1) {
-## 			  division <- rep(division,d.size)
-## 			}
-## 			if(length(Terminal)!=d.size) {
-## 			  cat("length of Terminal is not matched with model!\n")
-## 			  return(NULL)
-## 			}
-## 			if(length(division)!=d.size) {
-## 			  cat("length of division is not matched with model!\n")
-## 			  return(NULL)
-## 			}
-##             return(new("yuima.sampling", Terminal=Terminal, division=division ))
-##           }) 
-		  
-## setMethod("setSampling", signature(x="yuima"),
-##           function(x,Terminal=1,division=100){
-## 		    if(length(x at model@EQNS) == 0) {
-## 			  return(setSampling(x at data,Terminal,division))
-## 			}
-## 			return(setSampling(x at model,Terminal,division))
-##           }) 

Modified: pkg/yuima/man/adaBayes.Rd
===================================================================
--- pkg/yuima/man/adaBayes.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/adaBayes.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -29,9 +29,9 @@
   set.seed(1)
   diff.matrix <- matrix(c("theta1"),1,1)
   mod <- setModel(drift=c("(-1)*theta2*x"),diffusion=diff.matrix,time.variable="t",state.variable="x")
-  division <- 100
-  Terminal <- (division)^(1/3)
-  mod.sampling <- setSampling(Terminal=Terminal, division=division)
+  n <- 100
+  Terminal <- (n)^(1/3)
+  mod.sampling <- setSampling(Terminal=Terminal, n=n)
   yuima.mod <- setYuima(model=mod, sampling=mod.sampling)
   yuima.mod <- simulate(yuima.mod,
                xinit=1,
@@ -56,13 +56,13 @@
   QL <- 0
   param <- numeric(2)
   for( i in 1:5){
-    PAR <- ml.ql(yuima.mod,theta2= rand[i,1],theta1=rand[i,2],h=(division^(-2/3)))
+    PAR <- ml.ql(yuima.mod,theta2= rand[i,1],theta1=rand[i,2],h=(n^(-2/3)))
     if(PAR$value > QL){
       QL <- PAR$value
       param <- PAR$par
     }
   }
-  BE <- adaBayes(yuima.mod,h=(division-1)^(-2/3),prior2=prior2,prior1=prior1,domain2=domain,domain1=domain,theta2.offset=param[1],theta1.offset=param[2])
+  BE <- adaBayes(yuima.mod,h=(n-1)^(-2/3),prior2=prior2,prior1=prior1,domain2=domain,domain1=domain,theta2.offset=param[1],theta1.offset=param[2])
   print("True param")
   print("theta2 = .6, theta1 = .3")
   print("ML estimate")

Modified: pkg/yuima/man/cce.Rd
===================================================================
--- pkg/yuima/man/cce.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/cce.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -11,12 +11,12 @@
 cce(x)
 }
 \arguments{
-  \item{x}{an object of class 'yuima' or 'yuima.data'}
+  \item{x}{an object of  \code{\link{yuima-class}} or \code{\link{yuima.data-class}}.}
 }
 \details{
-  This function is a method of class \code{\link{yuima.data-class}} and \code{\link{yuima-class}}.
+  This function is a method for objects of \code{\link{yuima.data-class}} and \code{\link{yuima-class}}.
   It extracts the \code{data} slot when applied to a an object of
-  class \code{\link{yuima-class}}.
+   \code{\link{yuima-class}}.
 }
 \value{
   \item{value}{estimate of the covariance matrix}
@@ -46,7 +46,7 @@
 set.seed(111) 
 
 ## We use a function poisson.random.sampling to get observation by Poisson sampling.
-yuima.samp <- setSampling(Terminal = 1, division = 1200) 
+yuima.samp <- setSampling(Terminal = 1, n = 1200) 
 yuima <- setYuima(model = cor.mod, sampling = yuima.samp) 
 yuima <- simulate(yuima) 
 psample<- poisson.random.sampling(yuima, rate = c(0.2,0.3), n = 1000) 

Modified: pkg/yuima/man/limiting.gamma.Rd
===================================================================
--- pkg/yuima/man/limiting.gamma.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/limiting.gamma.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -31,8 +31,8 @@
 ## Yuima
 diff.matrix <- matrix(c("theta1"), 1, 1)
 myModel <- setModel(drift=c("(-1)*theta2*x"), diffusion=diff.matrix, time.variable="t", state.variable="x")
-division <- 100
-mySampling <- setSampling(Terminal=(division)^(1/3), division=division)
+n <- 100
+mySampling <- setSampling(Terminal=(n)^(1/3), n=n)
 myYuima <- setYuima(model=myModel, sampling=mySampling)
 myYuima <- simulate(myYuima, xinit=1, true.parameter=c(0.6, 0.3))
 

Modified: pkg/yuima/man/model.parameter-class.Rd
===================================================================
--- pkg/yuima/man/model.parameter-class.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/model.parameter-class.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -18,7 +18,7 @@
 		the Levy measure.}
     \item{\code{all}:}{A vector of names of all the parameters found in the 
 	components of the model.}
-    \item{\code{common}:}{Vector of names of the parameters in common among
+    \item{\code{common}:}{A vector of names of the parameters in common among
 	 drift, diffusion, jump and measure term.}
   }
 }

Modified: pkg/yuima/man/poisson.random.sampling.Rd
===================================================================
--- pkg/yuima/man/poisson.random.sampling.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/poisson.random.sampling.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -7,7 +7,7 @@
 poisson.random.sampling(x, rate, n)
 }
 \arguments{
-  \item{x}{an object of class \code{\link{yuima.data-class}} or \code{\link{yuima-class}}.}
+  \item{x}{an object of  \code{\link{yuima.data-class}} or \code{\link{yuima-class}}.}
   \item{rate}{a Poisson intensity or a vector of Poisson intensities.}
   \item{n}{a common multiplier to the Poisson intensities. The default value is 1.}
 }
@@ -15,10 +15,10 @@
   It returns an object
   of type \code{\link{yuima.data-class}} which is a copy of the original input 
   data where observations are sampled according to
-  the poisson process. The unsampled data are set to \code{NA}.
+  the Poisson process. The unsampled data are set to \code{NA}.
 }
 \value{
-  an object of class \code{\link{yuima.data-class}}.
+  an object of  \code{\link{yuima.data-class}}.
 }
 \author{The YUIMA Project Team}
 \seealso{\link{cce}}
@@ -35,7 +35,7 @@
 set.seed(111)
 
 ## We first simulate the two dimensional diffusion model
-yuima.samp <- setSampling(Terminal=1, division=1200)
+yuima.samp <- setSampling(Terminal=1, n=1200)
 yuima <- setYuima(model=cor.mod, sampling=yuima.samp)
 yuima.sim <- simulate(yuima)
 

Modified: pkg/yuima/man/quasi-likelihood.Rd
===================================================================
--- pkg/yuima/man/quasi-likelihood.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/quasi-likelihood.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -45,22 +45,22 @@
 #dXt^e = -theta2 * Xt^e * dt + theta1 * dWt
 diff.matrix <- matrix(c("theta1"), 1, 1)
 ymodel <- setModel(drift=c("(-1)*theta2*x"), diffusion=diff.matrix, time.variable="t", state.variable="x", solve.variable="x")
-division <- 100
+n <- 100
 
-ysamp <- setSampling(Terminal=(division)^(1/3), division=division) 
+ysamp <- setSampling(Terminal=(n)^(1/3), n=n) 
 yuima <- setYuima(model=ymodel, sampling=ysamp)
 set.seed(123)
 yuima <- simulate(yuima, xinit=1, true.parameter=c(0.3, 0.1))
-QL <- ql(yuima, 0.8, 0.7, h=1/((division)^(2/3)))
+QL <- ql(yuima, 0.8, 0.7, h=1/((n)^(2/3)))
 QL
 
 ## another way of parameter specification
 ##param <- list(theta2=0.8, theta1=0.7)
-##QL <- ql(yuima, h=1/((division)^(2/3)), param=param)
+##QL <- ql(yuima, h=1/((n)^(2/3)), param=param)
 ##QL
 
 system.time(
-opt <- ml.ql(yuima, 0.8, 0.7, h=1/((division)^(2/3)), c(0, 1), c(0, 1))
+opt <- ml.ql(yuima, 0.8, 0.7, h=1/((n)^(2/3)), c(0, 1), c(0, 1))
 )
 print("True param")
 print("theta2 = .3, theta1 = .1")
@@ -70,7 +70,7 @@
 ## another way of parameter specification
 ##interval <- list(theta2.lim=c(0,1), theta1.lim=c(0,1))
 ##system.time(
-##opt <- ml.ql(yuima, h=1/((division)^(2/3)), param=param, interval=interval)
+##opt <- ml.ql(yuima, h=1/((n)^(2/3)), param=param, interval=interval)
 ##)
 ##print("True param")
 ##print("theta2 = .3, theta1 = .1")
@@ -78,7 +78,7 @@
 ##opt$par
 
 system.time(
-opt <- ml.ql(yuima, 0.8, 0.7, h=1/((division)^(2/3)), c(0, 1), c(0, 1), BFGS=TRUE)
+opt <- ml.ql(yuima, 0.8, 0.7, h=1/((n)^(2/3)), c(0, 1), c(0, 1), BFGS=TRUE)
 )
 print("True param")
 print("theta2 = .3, theta1 = .1")
@@ -94,8 +94,8 @@
 
 ymodel <- setModel(drift=drift.matrix, diffusion=diff.matrix, time.variable="t",
                    state.variable=c("x1", "x2"), solve.variable=c("x1", "x2"))
-division <- 100
-ysamp <- setSampling(Terminal=(division)^(1/3), division=division)
+n <- 100
+ysamp <- setSampling(Terminal=(n)^(1/3), n=n)
 yuima <- setYuima(model=ymodel, sampling=ysamp)
 set.seed(123)
 
@@ -104,12 +104,12 @@
 
 theta2 <- c(0.8, 0.2) #c(theta2.1, theta2.2)
 theta1 <- c(0.7, 0.1) #c(theta1.1, theta1.2)
-QL <- ql(yuima, theta2, theta1, h=1/((division)^(2/3)))
+QL <- ql(yuima, theta2, theta1, h=1/((n)^(2/3)))
 QL
 
 ## another way of parameter specification
 #param <- list(theta2=theta2, theta1=theta1)
-#QL <- ql(yuima, h=1/((division)^(2/3)), param=param)
+#QL <- ql(yuima, h=1/((n)^(2/3)), param=param)
 #QL
 
 theta2.1.lim <- c(0, 1)
@@ -120,19 +120,19 @@
 theta1.lim <- t( matrix( c(theta1.1.lim, theta1.2.lim), 2, 2) )
 
 system.time(
-opt <- ml.ql(yuima, theta2, theta1, h=1/((division)^(2/3)), theta2.lim, theta1.lim)
+opt <- ml.ql(yuima, theta2, theta1, h=1/((n)^(2/3)), theta2.lim, theta1.lim)
 )
 opt$par
 
 ## another way of parameter specification
 #interval <- list(theta2.1.lim, theta2.2.lim, theta1.1.lim, theta1.2.lim)
 #system.time(
-#opt <- ml.ql(yuima, h=1/((division)^(2/3)), param=param, interval=interval)
+#opt <- ml.ql(yuima, h=1/((n)^(2/3)), param=param, interval=interval)
 #)
 #opt$par
 
 system.time(
-opt <- ml.ql(yuima, theta2, theta1, h=1/((division)^(2/3)), theta2.lim, theta1.lim, BFGS=TRUE)
+opt <- ml.ql(yuima, theta2, theta1, h=1/((n)^(2/3)), theta2.lim, theta1.lim, BFGS=TRUE)
 )
 opt$par
 

Modified: pkg/yuima/man/setData.Rd
===================================================================
--- pkg/yuima/man/setData.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/setData.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -8,13 +8,13 @@
 Set and access data of an object of type "yuima.data" or "yuima".
 }
 \description{
-\code{setData} constructs an object of class \code{\link{yuima.data-class}}.
+\code{setData} constructs an object of \code{\link{yuima.data-class}}.
 
 \code{get.zoo.data} returns the content of the \code{zoo.data} slot of a
 \code{\link{yuima.data-class}} object. (Note: value is a \code{list} of 
 \code{\link{zoo}} objects).
 
-\code{plot} plot method for object of class \code{\link{yuima.data-class}} or 
+\code{plot} plot method for object of \code{\link{yuima.data-class}} or 
 \code{\link{yuima-class}}.
 
 \code{dim} returns the \code{\link{dim}} of the \code{zoo.data} slot of a
@@ -35,29 +35,26 @@
   \code{\link{yuima-class}}.}
 }
 \details{
-Objects in the  \code{\link{yuima.data-class}} class contain two slots:
+Objects in the  \code{\link{yuima.data-class}} contain two slots:
 \describe{
   \item{\code{original.data}:}{The slot \code{original.data} contains, as the 
-   name suggests, a copy of the original data passed by the user in the
-   argument \code{original.data} of the function \code{setData}. 
-   It is intended for backup purposes.}
+   name suggests, a copy of the original data passed to the function 
+   \code{setData}. It is intended for backup purposes.}
   \item{\code{zoo.data}:}{the function \code{setData} tries to convert 
    \code{original.data} into an object of class \code{\link{zoo}}. The 
-   \code{\link{zoo}}-fied data are stored in the slot \code{zoo.data}.
-
+   coerced \code{\link{zoo}} data are stored in the slot \code{zoo.data}.
    If the conversion fails the function exits with an error.
-
    Internally, the \pkg{yuima} package stores and operates on  
    \code{\link{zoo}}-type objects.}
 }
 
 The function \code{get.zoo.data}
 returns the content of the slot \code{zoo.data} of \code{x} if \code{x}
-is of class \code{\link{yuima.data-class}} or the content of 
-\code{x at data@zoo.data} if \code{x} is of class \code{\link{yuima-class}}.
+is of \code{\link{yuima.data-class}} or the content of 
+\code{x at data@zoo.data} if \code{x} is of \code{\link{yuima-class}}.
 }
 \value{
-   \item{value}{a list of object(s) of class \code{\link{yuima.data-class}} for 
+   \item{value}{a list of object(s) of \code{\link{yuima.data-class}} for 
    \code{setData}. 
    The content of the \code{zoo.data}  slot for \code{get.zoo.data}}
 }

Modified: pkg/yuima/man/setModel.Rd
===================================================================
--- pkg/yuima/man/setModel.Rd	2009-12-19 15:41:38 UTC (rev 47)
+++ pkg/yuima/man/setModel.Rd	2009-12-20 10:29:27 UTC (rev 48)
@@ -58,31 +58,28 @@
 An object of \code{\link{yuima.model-class}} contains several slots:
 
 \describe{		
-\item{\code{drift}:}{is an \R expression which specifies the drift coefficient 
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/yuima -r 48


More information about the Yuima-commits mailing list