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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 21 00:51:31 CEST 2010


Author: iacus
Date: 2010-06-21 00:51:30 +0200 (Mon, 21 Jun 2010)
New Revision: 80

Modified:
   pkg/yuima/R/asymptotic_term.R
   pkg/yuima/R/limiting.gamma.R
   pkg/yuima/R/quasi-likelihood.R
   pkg/yuima/R/simFunctional.R
   pkg/yuima/R/simulate.R
   pkg/yuima/R/yuima.R
   pkg/yuima/R/yuima.characteristic.R
   pkg/yuima/R/yuima.functional.R
   pkg/yuima/R/yuima.model.R
   pkg/yuima/R/yuima.sampling.R
   pkg/yuima/man/simulate.Rd
Log:
added yuima.warn

Modified: pkg/yuima/R/asymptotic_term.R
===================================================================
--- pkg/yuima/R/asymptotic_term.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/asymptotic_term.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -387,7 +387,7 @@
     }
     if(any(eigen(sigma)$value<=0.0001)){
     # Singularity check
-      cat("Eigen value of covariance matrix in very small.\n")
+      yuima.warn("Eigen value of covariance matrix in very small.")
     }
     return(sigma)
   }
@@ -1348,7 +1348,7 @@
     dede.diffusion[i] <- list(Derivation.scalar(de.diffusion[[i]],pars,r.size))
   }
   
-  cat("Get variables ...")
+  yuima.warn("Get variables ...")
   Y <- Get.Y()
   mu <- funcmu()
   aMat <- funca()
@@ -1465,20 +1465,20 @@
   de.rho <- get.de.rho()
   H0 <- get.H0()
 
-  cat("done\n")
-  cat("initializing ...")
+  yuima.warn("Done.")
+  yuima.warn("Initializing ...")
   dat.di.bar <- get.di.bar.init()
   dat.dij <- get.dij.init()
   dat.el <- get.el.init()
-  cat("done\n")
+  yuima.warn("Done.")
   
   ## calculation
-  cat("calculating d0 ...")
+  yuima.warn("Calculating d0 ...")
   d0 <- get.d0.term()
-  cat("done\n")
-  cat("calculating d1 term ...")
+  yuima.warn("Done\n")
+  yuima.warn("Calculating d1 term ...")
   d1 <- get.d1.term()
-  cat("done\n")
+  yuima.warn("Done\n")
   terms <- list(d0=d0$value, d1=d1$value)
   return(terms)
  })

Modified: pkg/yuima/R/limiting.gamma.R
===================================================================
--- pkg/yuima/R/limiting.gamma.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/limiting.gamma.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -21,7 +21,7 @@
             }
             
             if(verbose){
-              cat("initialize ... ")
+              yuima.warn("Initializing... ")
             }
             
             r.size <- obj at noise.number
@@ -70,11 +70,11 @@
               assign(THETA.2[i], theta[[2]][i])
             }            
             if(verbose){
-              cat("done\n")
+              yuima.warn("Done")
             }            
             ## p(x)            
             if(verbose){
-              cat("get C ... ")
+              yuima.warn("get C ... ")
             }
             
             ## a part of p(x) function  
@@ -119,12 +119,12 @@
             ## normalize const
             C <- 1/integrate(integrate.p0.x, -Inf, Inf)$value            
             if(verbose){
-              cat("done\n")
+              yuima.warn("Done")
             }
             
             ## gamma1            
             if(verbose){
-              cat("get gamma1 ... ")
+              yuima.warn("Get gamma1 ... ")
             }
             counter.gamma1 <- 1
             
@@ -171,12 +171,12 @@
               counter.gamma1 <- counter.gamma1+1
             }            
             if(verbose){
-              cat("done\n")
+              yuima.warn("Done")
             }
             
             ## gamma2            
             if(verbose){
-              cat("get gamma2 ... ")
+              yuima.warn("Get gamma2 ... ")
             }
             counter.gamma2 <- 1
             
@@ -217,7 +217,7 @@
               counter.gamma2 <- counter.gamma2+1
             }            
             if(verbose){
-              cat("done\n")
+              yuima.warn("Done")
             }
             
             ## make list for return 

Modified: pkg/yuima/R/quasi-likelihood.R
===================================================================
--- pkg/yuima/R/quasi-likelihood.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/quasi-likelihood.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -131,25 +131,25 @@
             ##QLG <- ql.grad(yuima, theta2, theta1, h, print=FALSE)
             ##print(QLG)
             if( missing(yuima)){
-              cat("\nyuima object is missing.\n")
+              yuima.warn("yuima object is missing.")
               return(NULL)
             }
             
             ## param handling
             if( missing(param) ){
               if( missing(theta2) || missing(theta1) ){
-                cat("\nparameters of yuima.model is missing.\n")
+                yuima.warn("Parameters of yuima.model are missing.")
                 return(NULL)
               }              
             }else{
               if( missing(theta2) && missing(theta1) ){
                 if( !is.list(param) ){
-                  cat("\nparam must be list.\n")
+                  yuima.warn("param must be list.")
                   return(NULL)
                 }
 
                 if( length(param)!=2){
-                  cat("\nlength of param is strange.\n")
+                  yuima.warn("length of param is strange.")
                   return(NULL)
                 }
                 
@@ -167,28 +167,28 @@
                   theta1 <- as.vector(param[[1]])
                 }
                 else{
-                  cat("\nnames of param are strange.\n")
+                  yuima.warn("names of param are strange.")
                   return(NULL)
                 }
               }else{
-                cat("\nConflict in parameter specification method.\n")
+                yuima.warn("Conflict in parameter specification method.")
                 return(NULL)
               }
             }
             ## END param handling
                 
             if( missing(h)){
-              cat("\nlength of each time is missing.\n")
+              yuima.warn("length of each time is missing.")
               return(NULL)
             }
 
             if(length(yuima at model@parameter at drift)!=length(theta2)){
-              cat("\nlength of drift parameter is strange.\n")
+              yuima.warn("length of drift parameter is strange.")
               return(NULL)
             }
             
             if(length(yuima at model@parameter at diffusion)!=length(theta1)){
-              cat("\nlength of diffusion parameter is strange.\n")
+              yuima.warn("length of diffusion parameter is strange.")
               return(NULL)
             }
             
@@ -244,23 +244,23 @@
 
 ql.grad <- function(yuima, theta2, theta1, h, print=FALSE){
   if( missing(yuima)){
-    cat("\nyuima object is missing.\n")
+    yuima.warn("yuima object is missing.")
     return(NULL)
   }
   if( missing(theta2) || missing(theta1)){
-    cat("\nparameters of yuima.model is missing.\n")
+    yuima.warn("parameters of yuima.model are missing.")
     return(NULL)
   }
   if( missing(h)){
-    cat("\nlength of each time is missing.\n")
+    yuima.warn("length of each time is missing.")
     return(NULL)
   }
   if(length(yuima at model@parameter at drift)!=length(theta2)){
-    cat("\nlength of drift parameter is strange.\n")
+    yuima.warn("length of drift parameter is strange.")
     return(NULL)
   }
   if(length(yuima at model@parameter at diffusion)!=length(theta1)){
-    cat("\nlength of diffusion parameter is strange.\n")
+    yuima.warn("length of diffusion parameter is strange.")
     return(NULL)
   }
   
@@ -319,25 +319,25 @@
 setMethod("rql", "yuima",
           function(yuima, theta2, theta1, ptheta2, ptheta1, h, print=FALSE, param, prevparam){
             if(missing(yuima)){
-              cat("\nyuima object is missing.\n")
+              yuima.warn("yuima object is missing.")
               return(NULL)
             }
             
             ## param handling
             if( missing(param) ){
               if( missing(theta2) || missing(theta1) ){
-                cat("\nparameters of yuima.model is missing.\n")
+                yuima.warn("parameters of yuima.model is missing.")
                 return(NULL)
               }              
             }else{
               if( missing(theta2) && missing(theta1) ){
                 if( !is.list(param) ){
-                  cat("\nparam must be list.\n")
+                  yuima.warn("param must be list.")
                   return(NULL)
                 }
 
                 if( length(param)!=2){
-                  cat("\nlength of param is strange.\n")
+                  yuima.warn("length of param is strange.")
                   return(NULL)
                 }
                 
@@ -355,11 +355,11 @@
                   theta1 <- as.vector(param[[1]])
                 }
                 else{
-                  cat("\nnames of param are strange.\n")
+                  yuima.warn("names of param are strange.")
                   return(NULL)
                 }
               }else{
-                cat("\nConflict in parameter specification method.\n")
+                yuima.warn("Conflict in parameter specification method.")
                 return(NULL)
               }
             }
@@ -368,17 +368,17 @@
             ## prevparam handling
             if( missing(prevparam) ){
               if( missing(ptheta2) || missing(ptheta1) ){
-                cat("\nparameters of yuima.model is missing.\n")
+                yuima.warn("parameters of yuima.model is missing.")
                 return(NULL)
               }              
             }else{
               if( missing(ptheta2) && missing(ptheta1) ){
                 if( !is.list(prevparam) ){
-                  cat("\nparam must be list.\n")
+                  yuima.warn("param must be list.")
                   return(NULL)
                 }
                 if( length(prevparam)!=2){
-                  cat("\nlength of param is strange.\n")
+                  yuima.warn("length of param is strange.")
                   return(NULL)
                 }
                 
@@ -396,27 +396,27 @@
                   ptheta1 <- as.vector(prevparam[[1]])
                 }
                 else{
-                  cat("\nnames of prevparam are strange.\n")
+                  yuima.warn("names of prevparam are strange.")
                   return(NULL)
                 }
                 
               }else{
-                cat("\nConflict in parameter specification method.")
+                yuima.warn("Conflict in parameter specification method.")
                 return(NULL)
               }
             }
             ## END prevparam handling
 
             if(missing(h)){
-              cat("\nlength of each time is missing.\n")
+              yuima.warn("length of each time is missing.")
               return(NULL)
             }
             if(length(yuima at model@parameter at drift)!=length(theta2)){
-              cat("\nlength of drift parameter is strange.\n")
+              yuima.warn("length of drift parameter is strange.")
               return(NULL)
             }
             if(length(yuima at model@parameter at diffusion)!=length(theta1)){
-              cat("\nlength of diffusion parameter is strange.\n")
+              yuima.warn("length of diffusion parameter is strange.")
               return(NULL)
             }
             
@@ -789,25 +789,25 @@
                    method="optim", #(BFGS, Newton)
                    param, interval){
             if( missing(yuima)){
-              cat("\nyuima object is missing.\n")
+              yuima.warn("yuima object is missing.")
               return(NULL)
             }
 
             ## param handling
             if( missing(param) ){
               if( missing(theta2) || missing(theta1) ){
-                cat("\nparameters of yuima.model is missing.\n")
+                yuima.warn("parameters of yuima.model is missing.")
                 return(NULL)
               }              
             }else{
               if( missing(theta2) && missing(theta1) ){
                 if( !is.list(param) ){
-                  cat("\nparam must be list.\n")
+                  yuima.warn("param must be list.")
                   return(NULL)
                 }
 
                 if( length(param)!=2){
-                  cat("\nlength of param is strange.\n")
+                  yuima.warn("length of param is strange.")
                   return(NULL)
                 }
                 
@@ -825,11 +825,11 @@
                   theta1 <- as.vector(param[[1]])
                 }
                 else{
-                  cat("\nnames of param are strange.\n")
+                  yuima.warn("names of param are strange.")
                   return(NULL)
                 }
               }else{
-                cat("\nConflict in parameter specification method.\n")
+                yuima.warn("Conflict in parameter specification method.")
                 return(NULL)
               }
             }
@@ -837,15 +837,15 @@
             
 
             if(length(yuima at model@parameter at drift)!=length(theta2)){
-              cat("\nlength of drift parameter is strange.\n")
+              yuima.warn("length of drift parameter is strange.")
               return(NULL)
             }
             if(length(yuima at model@parameter at diffusion)!=length(theta1)){
-              cat("\nlength of diffusion parameter is strange.\n")
+              yuima.warn("length of diffusion parameter is strange.")
               return(NULL)
             }
             if( missing(h)){
-              cat("\nlength of each time is missing.\n")
+              yuima.warn("length of each time is missing.")
               return(NULL)
             }
 
@@ -853,7 +853,7 @@
             if( !missing(interval) ){
               if( missing(theta2.lim) && missing(theta2.lim) ){
                 if( !is.list(interval) ){
-                  cat("\ninterval must be list.\n")
+                  yuima.warn("interval must be list.")
                   return(NULL)
                 }
 
@@ -861,7 +861,7 @@
                 theta1.len <- length(yuima at model@parameter at diffusion)
                 
                 if( length(interval) !=  (theta2.len+theta1.len) ){
-                  cat("\nlength of interval is strange.\n")
+                  yuima.warn("length of interval is strange.")
                   return(NULL)
                 }
                 
@@ -875,7 +875,7 @@
                   theta1.lim <- rbind(theta1.lim, interval[[theta2.len+i]])
                 }
               }else{
-                cat("\nConflict in parameter specification method.\n")
+                yuima.warn("Conflict in parameter specification method.")
                 return(NULL)
               }
             }
@@ -905,16 +905,16 @@
             }else{ ## optim
               if(is.matrix(theta2.lim) && is.matrix(theta1.lim)){
                 if(ncol(theta2.lim)!=2 || ncol(theta1.lim)!=2){
-                  cat("\ntheta.lim is not available.\n")
+                  yuima.warn("theta.lim is not available.")
                   return(NULL)    
                 }
               }
               if( length(theta2)!=1 && length(theta2)!=nrow(theta2.lim)){
-                cat("\nsize of theta2 and theta2.lim are different.\n")
+                yuima.warn("size of theta2 and theta2.lim are different.")
                 return(NULL)    
               }
               if( length(theta1)!=1 && length(theta1)!=nrow(theta1.lim)){
-                cat("\nsize of theta1 and theta1.lim are different.\n")
+                yuima.warn("size of theta1 and theta1.lim are different.")
                 return(NULL)    
               }
             
@@ -1048,7 +1048,7 @@
                 stop("\ninterval missing.\n")
               }
               if(!missing(theta2.init)){
-                cat("\ntheta2.init is ignored.\n")
+                yuima.warn("theta2.init is ignored.")
               }
               
               opt <- optimize(f=Mn, interval=interval, tol=1e-100, ...)
@@ -1060,7 +1060,7 @@
                 stop("\ntheta2.init missing.\n")
               }
               if(!missing(interval)){
-                cat("\ninterval is ignored.\n")
+                yuima.warn("interval is ignored.")
               }
               
               opt <- optim(c(theta2.init), fn=Mn, gr=NULL, ...)

Modified: pkg/yuima/R/simFunctional.R
===================================================================
--- pkg/yuima/R/simFunctional.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/simFunctional.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -19,7 +19,7 @@
           }
 
 # funcf
-# function to calculate fa's in (13.2)
+# function to calculate fa in (13.2)
 funcf <- function(yuima,X,e){ 
             division <- yuima at sampling@n  #number of observed time
             F <- getF(yuima at functional)
@@ -151,11 +151,11 @@
           function(yuima){
 		    Xlen <- length(yuima at data)
 			if(sum(Xlen != mean(Xlen)) != 0) {
-			  cat("\nAll length must be same yet.\n")
+			  yuima.warn("All length must be same yet.")
 			  return(NULL)
 			}
             if( (Xlen[1]-1) != yuima at sampling@n){
-              cat("\nLength of time series and division do not much.\n")
+              yuima.warn("Length of time series and division do not much.")
               return(NULL)
             }
             

Modified: pkg/yuima/R/simulate.R
===================================================================
--- pkg/yuima/R/simulate.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/simulate.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -12,7 +12,7 @@
 subsampling <- function(x,y) return(x)
 
 setGeneric("simulate",
-	function(object, nsim, seed, xinit, true.parameter, space.discretized=FALSE, 
+	function(object, nsim=1, seed=NULL, xinit, true.parameter, space.discretized=FALSE, 
 		increment.W=NULL, increment.L=NULL, methodfGn="Cholesky", 
 		sampling=sampling, subsampling=subsampling, ...
 #		Initial = 0, Terminal = 1, n = 100, delta, 
@@ -66,7 +66,7 @@
   yuima <- object
 				
   if(missing(yuima)){
-    cat("\nyuima object is missing.\n")
+    yuima.warn("yuima object is missing.")
     return(NULL)
   }
 
@@ -99,7 +99,7 @@
 					if(length(xinit)==1){
 						xinit <- rep(xinit, d.size)
 					}else{
-						cat("\nDimension of xinit variables missmatch.\n")
+						yuima.warn("Dimension of xinit variables missmatch.")
 						return(NULL)
 					}
 				}
@@ -146,13 +146,13 @@
   ##:: Error check for increment specified version.
   if(!missing(increment.W) & !is.null(increment.W)){
     if(space.discretized == TRUE){
-      cat("\nParameter increment must be invalid if space.discretized=TRUE.\n")
+      yuima.warn("Parameter increment must be invalid if space.discretized=TRUE.")
       return(NULL)
     }else if(dim(increment.W)[1] != r.size){
-      cat("\nLength of increment's row must be same as yuima at model@noise.number.\n")
+      yuima.warn("Length of increment's row must be same as yuima at model@noise.number.")
       return(NULL)
     }else if(dim(increment.W)[2] != n){
-      cat("\nLength of increment's column must be same as sampling at n[1].\n")
+      yuima.warn("Length of increment's column must be same as sampling at n[1].")
       return(NULL)
     }
   }
@@ -160,13 +160,13 @@
     ##:: Error check for increment specified version.
   if(!missing(increment.L) & !is.null(increment.L)){
     if(space.discretized == TRUE){
-      cat("\nParameter increment must be invalid if space.discretized=TRUE.\n")
+      yuima.warn("Parameter increment must be invalid if space.discretized=TRUE.")
       return(NULL)
     }else if(dim(increment.L)[1] != r.size){
-      cat("\nLength of increment's row must be same as yuima at model@noise.number.\n")
+      yuima.warn("Length of increment's row must be same as yuima at model@noise.number.")
       return(NULL)
     }else if(dim(increment.L)[2] != n){
-      cat("\nLength of increment's column must be same as sampling at n[1].\n")
+      yuima.warn("Length of increment's column must be same as sampling at n[1].")
       return(NULL)
     }
   }
@@ -193,7 +193,7 @@
 		if(methodfGn=="Cholesky"){
 			dW<-CholeskyfGn(grid, sdeModel at hurst,r.size)
 		} else {
-			cat("\nNot done presently\n")
+			yuima.warn("Not done presently.")
 			return(NULL)	
 		}
 						

Modified: pkg/yuima/R/yuima.R
===================================================================
--- pkg/yuima/R/yuima.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/yuima.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -1,3 +1,6 @@
+yuima.warn <- function(x) 
+   cat(sprintf("\nYUIMA: %s\n", x))
+
 ## Constructor and Initializer of class 'yuima'
 
 # we convert objects to "zoo" internally
@@ -15,7 +18,7 @@
             if(!is.null(model)){
               if(!is.null(eqn)){
                 if(eqn!=model at equation.number){
-                  cat("\nModel's equation number missmatch.\n")
+                  yuima.warn("Model's equation number missmatch.")
                   return(NULL)
                 }
               }else{
@@ -31,7 +34,7 @@
                     sampling at Terminal <- rep(sampling at Terminal, eqn)
                     sampling at n <- rep(sampling at n, eqn)
                   }else{
-                    cat("\nSampling's equation number missmatch.\n")
+                    yuima.warn("Sampling's equation number missmatch.")
                     return(NULL)
                   }
                 }
@@ -44,7 +47,7 @@
             if(!is.null(characteristic)){
               if(!is.null(eqn)){
                 if(eqn!=characteristic at equation.number){
-                  cat("\nCharacteristic's equation number missmatch.\n")
+                  yuima.warn("Characteristic's equation number missmatch.")
                   return(NULL)                  
                 }
               }

Modified: pkg/yuima/R/yuima.characteristic.R
===================================================================
--- pkg/yuima/R/yuima.characteristic.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/yuima.characteristic.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -8,7 +8,7 @@
                .Object at equation.number <- equation.number
                .Object at time.scale <- time.scale
              }else{
-               cat("\nDimension missmatch\n")
+               yuima.warn("Dimension missmatch")
                return(NULL)
              }
              return(.Object)

Modified: pkg/yuima/R/yuima.functional.R
===================================================================
--- pkg/yuima/R/yuima.functional.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/yuima.functional.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -28,15 +28,15 @@
   function(model, F, f, xinit, e){
     # error check
     if( missing(model)){
-      cat("\nyuima.model is missing.\n")
+      yuima.warn("yuima.model is missing.")
       return(NULL)
     }
     if( missing(xinit)){
-      cat("\nInitial value of state variable is missing\n")
+      yuima.warn("Initial value of state variable is missing.")
       return(NULL)
     }
     if( missing(f) || missing(F) || missing(e)){
-      cat("\nFunctional specification is incomplete.\n")
+      yuima.warn("Functional specification is incomplete.")
       return(NULL)
     }
 
@@ -45,15 +45,15 @@
     k.size <- length(F)
 
     if( length(f) != (r.size + 1)){
-      cat("\nFunctional needs r+1 f_alphas\n")
+      yuima.warn("Functional needs r+1 f_alphas.")
       return(NULL)
     }
     if( length(f[[1]]) != k.size){
-      cat("\nMissmatch in dimension of functional\n")
+      yuima.warn("Missmatch in dimension of functional.")
       return(NULL)
     }
     if( length(xinit) != d.size){
-      cat("\nMissmatch in dimension of functional and state variables\n")
+      yuima.warn("Missmatch in dimension of functional and state variables.")
       return(NULL)
     }
     

Modified: pkg/yuima/R/yuima.model.R
===================================================================
--- pkg/yuima/R/yuima.model.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/yuima.model.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -79,23 +79,23 @@
   
   if(!length(measure.type)){
     if( length(jump.coeff) || length(measure) ){
-      cat("\nmeasure type isn't matched with jump term.\n")
+      yuima.warn("measure type does not match with jump term.")
       return(NULL)
     }
     jump.variable <- character()
     measure.par <- character()
   }else{
     if( !length(jump.coeff) || !length(measure) ){
-      cat("\nmeasure type isn't matched with jump term.\n")
+      yuima.warn("measure type isn't matched with jump term.")
       return(NULL)
     }else if(length(jump.coeff)!=1){
-      cat("\nmulti dimentional jump term is not supported yet.\n")
+      yuima.warn("multi dimentional jump term is not supported yet.")
       return(NULL)
     }
     
     if(measure.type=="CP"){ ##::CP
       if(length(measure)!=2){
-        cat(paste("\nlength of measure must be two on type", measure.type, ".\n"))
+        yuima.warn(paste("length of measure must be two on type", measure.type, "."))
         return(NULL)
       }
       
@@ -103,7 +103,7 @@
         measure <- list(intensity=measure[1], df=measure[2])
       }else{
         if(length(measure[[1]])!=1 || length(measure[[2]])!=1){
-          cat("\nmulti dimentional jump term is not supported yet.\n")
+          yuima.warn("multi dimentional jump term is not supported yet.")
           return(NULL)
         }
         ##::naming measure list ########
@@ -117,18 +117,18 @@
             if(names(measure)[-whichint]=="" || names(measure)[-whichint]=="df"){
               names(measure)[-whichint] <- "df"
             }else{
-              cat("\nnames of measure are incorrect.\n")
+              yuima.warn("names of measure are incorrect.")
               return(NULL)
             }
           }else if(!is.na(whichdf)){
             if(names(measure)[-whichdf]=="" || names(measure)[-whichdf]=="intensity"){
               names(measure)[-whichdf] <- "intensity"
             }else{
-              cat("\nnames of measure are incorrect.\n")
+              yuima.warn("names of measure are incorrect.")
               return(NULL)
             }
           }else{
-            cat("\nnames of measure are incorrect.\n")
+            yuima.warn("names of measure are incorrect.")
             return(NULL)
           }
         }
@@ -139,7 +139,7 @@
       tmp <- regexpr("\\(", measure$df)[1]
       measurefunc <- substring(measure$df, 1, tmp-1)
       if(!is.na(match(measurefunc, codelist))){
-        cat(paste("\ndistribution function", measurefunc, "should be defined as type code.\n"))
+        yuima.warn(paste("distribution function", measurefunc, "should be defined as type code."))
         return(NULL)
       }else if(is.na(match(measurefunc, CPlist))){
         warning(paste("\ndistribution function", measurefunc, "is not officialy supported as type CP.\n"))
@@ -154,7 +154,7 @@
       ##::end CP
     }else if(measure.type=="code"){ ##::code
       if(length(measure)!=1){
-        cat(paste("\nlength of measure must be one on type", measure.type, ".\n"))
+        yuima.warn(paste("length of measure must be one on type", measure.type, "."))
         return(NULL)
       }
       
@@ -162,14 +162,14 @@
         measure <- list(df=measure)
       }else{
         if(length(measure[[1]])!=1){
-          cat("\nmulti dimentional jump term is not supported yet.\n")
+          yuima.warn("multi dimentional jump term is not supported yet.")
           return(NULL)
         }
         ##::naming measure list #############
         if(is.null(names(measure)) || names(measure)=="df"){
           names(measure) <- "df"
         }else{
-          cat("\nname of measure is incorrect.\n")
+          yuima.warn("name of measure is incorrect.")
           return(NULL)
         }
         ##::end naming measure list #############
@@ -179,7 +179,7 @@
       tmp <- regexpr("\\(", measure$df)[1]
       measurefunc <- substring(measure$df, 1, tmp-1)
       if(!is.na(match(measurefunc, CPlist))){
-        cat(paste("\ndistribution function", measurefunc, "should be defined as type CP.\n"))
+        yuima.warn(paste("\ndistribution function", measurefunc, "should be defined as type CP."))
         return(NULL)
       }else if(is.na(match(measurefunc, codelist))){
         warning(paste("\ndistribution function", measurefunc, "is not officialy supported as type code.\n"))
@@ -192,7 +192,7 @@
       ##::end code
     }else if(measure.type=="density"){ ##::density
       if(length(measure)!=1){
-        cat(paste("\nlength of measure must be one on type", measure.type, ".\n"))
+        yuima.warn(paste("length of measure must be one on type", measure.type, "."))
         return(NULL)
       }
       
@@ -200,7 +200,7 @@
         measure <- list(df=measure)
       }else{
         if(length(measure[[1]])!=1){
-          cat("\nmulti dimentional jump term is not supported yet.\n")
+          yuima.warn("multi dimentional jump term is not supported yet.")
           return(NULL)
         }
         
@@ -208,7 +208,7 @@
         if(is.null(names(measure))){
           names(measure) <- "df"
         }else if(names(measure)!="density" && names(measure)!="df"){
-          cat("\nname of measure is incorrect.\n")
+          yuima.warn("name of measure is incorrect.")
           return(NULL)
         }
         ##::end naming measure list #############
@@ -218,10 +218,10 @@
       tmp <- regexpr("\\(", measure[[names(measure)]])[1]
       measurefunc <- substring(measure[[names(measure)]], 1, tmp-1)
       if(!is.na(match(measurefunc, CPlist))){
-        cat(paste("\ndistribution function", measurefunc, "should be defined as type CP.\n"))
+        yuima.warn(paste("distribution function", measurefunc, "should be defined as type CP."))
         return(NULL)
       }else if(!is.na(match(measurefunc, codelist))){
-        cat(paste("\ndistribution function", measurefunc, "should be defined as type code.\n"))
+        yuima.warn(paste("distribution function", measurefunc, "should be defined as type code."))
         return(NULL)
       }
       MEASURE[[names(measure)]]$func <- eval(parse(text=measurefunc))
@@ -231,7 +231,7 @@
       ##::end check df name ####################
       ##::end density
     }else{ ##::else
-      cat(paste("\nmeasure type", measure.type, "isn't supported.\n"))
+      yuima.warn(paste("measure type", measure.type, "isn't supported."))
       return(NULL)
     }
     n.eqn3 <- 1
@@ -243,7 +243,7 @@
   
   ##:: check for errors and reform values
   if(any(time.variable %in% state.variable)){
-    cat("\ntime and state(s) variable must be different\n")
+    yuima.warn("time and state(s) variable must be different.")
     return(NULL)
   }
   if(is.null(dim(drift))){ # this is a vector
@@ -276,7 +276,7 @@
   }
 
   if(n.eqn1 != n.eqn2 || n.eqn1 != n.eqn3){
-    cat("\nMalformed model, number of equations in the drift and diffusion do not match\n")
+    yuima.warn("Malformed model, number of equations in the drift and diffusion do not match.")
     return(NULL)
   }
   n.eqn <- n.eqn1
@@ -287,17 +287,17 @@
     if(length(xinit)==1){
       xinit <- rep(xinit, n.eqn)
     }else{
-      cat("\nDimension of xinit variables missmuch.\n")
+      yuima.warn("Dimension of xinit variables missmatch.")
       return(NULL)
     }
   }
   
   if(missing(solve.variable)){
-    cat("\nSolution variable (lhs) not specified. Trying to use state variables\n")
+    yuima.warn("Solution variable (lhs) not specified. Trying to use state variables.")
     solve.variable <- state.variable
   }
   if(n.eqn != length(solve.variable)){
-    cat("\nMalformed model, number of solution variables (lhs) do no match number of equations (rhs)\n")
+    yuima.warn("Malformed model, number of solution variables (lhs) do no match number of equations (rhs).")
     return(NULL)
   }
   

Modified: pkg/yuima/R/yuima.sampling.R
===================================================================
--- pkg/yuima/R/yuima.sampling.R	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/R/yuima.sampling.R	2010-06-20 22:51:30 UTC (rev 80)
@@ -33,7 +33,7 @@
 # grid given              
 				if(!is.null(grid)){
 					if(!is.list(grid)){
-						cat("\nYUIMA: attempting to coerce 'grid' to a list, unexpected results may occur!\n")
+						yuima.warn("attempting to coerce 'grid' to a list, unexpected results may occur!")
 						grid <- list(grid)
 					}
 				   grid <- lapply(grid, sort) # we make sure grids are ordered
@@ -48,7 +48,6 @@
 				}
 # grid is missing, but random sampling					
 				if(!is.logical(random)){
-					cat("\nrandom\n")
 					.Object at regular <- FALSE
 					.Object at Terminal <- numeric(0)	
 					.Object at Initial <- Initial
@@ -81,7 +80,7 @@
 					delta <- rep(delta, ndim)[1:ndim]
 					n <- rep(n, ndim)[1:ndim] 	
 					Terminal <- Initial + n*delta 	
-					cat("\nYUIMA: 'Terminal' (re)defined\n")
+					yuima.warn("'Terminal' (re)defined.")
 					for(i in 1:ndim)
 						grid[[i]] <- seq(Initial[i], Terminal[i], by=delta[i])
 					
@@ -107,7 +106,7 @@
 						stop("\nYUIMA: 'Terminal' < 'Initial'\n")	
 					n <- rep(n, ndim)[1:ndim] 	
 					delta <- (Terminal-Initial)/n 						 
-					cat("\nYUIMA: 'delta' (re)defined\n")
+					yuima.warn("'delta' (re)defined.")
 					for(i in 1:ndim)
 						grid[[i]] <- seq(Initial[i], Terminal[i], by=delta[i])					
 				}

Modified: pkg/yuima/man/simulate.Rd
===================================================================
--- pkg/yuima/man/simulate.Rd	2010-06-20 22:13:50 UTC (rev 79)
+++ pkg/yuima/man/simulate.Rd	2010-06-20 22:51:30 UTC (rev 80)
@@ -182,7 +182,8 @@
                       space.discretized=FALSE,
                       increment.W=my.dW)
 if( !is.null(yuima.mod) ){
-  x11()
+ dev.new()
+ # x11()
   plot(yuima.mod)
 }
 
@@ -226,7 +227,8 @@
 ## Solve SDEs using Euler-Maruyama method.
 yuima.obj.path <- simulate(yuima.obj, space.discretized=FALSE, increment.W=my.dW)
 if( !is.null(yuima.obj.path) ){
-  x11()
+  dev.new()
+#  x11()
   plot(yuima.obj.path)
 }
 



More information about the Yuima-commits mailing list