[Yuima-commits] r165 - pkg/yuima/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 1 06:48:53 CEST 2011


Author: kamatani
Date: 2011-08-01 06:48:51 +0200 (Mon, 01 Aug 2011)
New Revision: 165

Modified:
   pkg/yuima/man/llag.Rd
Log:
Add a 3-dim example.

Modified: pkg/yuima/man/llag.Rd
===================================================================
--- pkg/yuima/man/llag.Rd	2011-07-31 09:42:37 UTC (rev 164)
+++ pkg/yuima/man/llag.Rd	2011-08-01 04:48:51 UTC (rev 165)
@@ -26,33 +26,38 @@
 \author{The YUIMA Project Team}
 \examples{
 
-
 ## Set a model
-diff.coef.matrix <- matrix(c("sqrt(x1)", "sqrt(3/5)*sqrt(x2)", 
-"", "sqrt(4/5)*sqrt(x2)"), 2, 2) 
-drift <- c("-x1","2*(10-x2)")
-cor.mod <- setModel(drift = drift, diffusion = diff.coef.matrix,solve.variable = c("x1", "x2")) 
+diff.coef.matrix <- matrix(c("sqrt(x1)", "3/5*sqrt(x2)","1/3*sqrt(x3)", 
+"", "4/5*sqrt(x2)","2/3*sqrt(x3)","","","2/3*sqrt(x3)"), 3, 3) 
+drift <- c("1-x1","2*(10-x2)","3*(4-x3)")
+cor.mod <- setModel(drift = drift, diffusion = diff.coef.matrix,solve.variable = c("x1", "x2","x3")) 
 
 set.seed(111) 
 
 ## We use a function poisson.random.sampling to get observation by Poisson sampling.
 yuima.samp <- setSampling(Terminal = 1, n = 1200) 
 yuima <- setYuima(model = cor.mod, sampling = yuima.samp) 
-yuima <- simulate(yuima,xinit=c(1,7)) 
+yuima <- simulate(yuima,xinit=c(1,7,5)) 
 
 # intentionally displace the second time series
 
   data2 <- yuima at data@zoo.data[[2]]
-  time <- time(data2)
+  time2 <- time(data2)
+  theta2 <- 0.05   # the lag of x2 behind x1
+  stime2 <- time2 + theta2  
+  time(yuima at data@zoo.data[[2]]) <- stime2
 
-  theta <- 0.05   # the degree of lag
+  data3 <- yuima at data@zoo.data[[3]]
+  time3 <- time(data3)
+  theta3 <- 0.12   # the lag of x3 behind x1
+  stime3 <- time3 + theta3 
+  time(yuima at data@zoo.data[[3]]) <- stime3
 
-  stime <- time + theta  
-  time(yuima at data@zoo.data[[2]]) <- stime
 
 
+
 #sampled data by Poisson rules
-psample<- poisson.random.sampling(yuima, rate = c(0.2,0.3), n = 1000) 
+psample<- poisson.random.sampling(yuima, rate = c(0.2,0.3,0.4), n = 1000) 
 
 
 # plot



More information about the Yuima-commits mailing list