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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Apr 27 03:52:59 CEST 2017


Author: eguchi
Date: 2017-04-27 03:52:59 +0200 (Thu, 27 Apr 2017)
New Revision: 606

Modified:
   pkg/yuima/man/IC.Rd
Log:
modified

Modified: pkg/yuima/man/IC.Rd
===================================================================
--- pkg/yuima/man/IC.Rd	2017-04-27 01:52:33 UTC (rev 605)
+++ pkg/yuima/man/IC.Rd	2017-04-27 01:52:59 UTC (rev 606)
@@ -104,14 +104,16 @@
 mod <- setModel(drift="theta21*x", diffusion="exp((theta11*cos(x)+theta12)/2)")
 samp <- setSampling(Terminal=Ter, n = N)
 yuima <- setYuima(model=mod, sampling=setSampling(Terminal=Ter, n=50*N))
-simu.yuima <- simulate(yuima, xinit=1, true.parameter=list(theta11=-2, theta12=1, theta21=-1), subsampling=samp)
+simu.yuima <- simulate(yuima, xinit=1, true.parameter=list(theta11=-2, theta12=1, 
+                       theta21=-1), subsampling=samp)
 Xt <- NULL
 for(i in 1:(N+1)){
   Xt <- c(Xt, simu.yuima at data@original.data[50*(i-1)+1])
 }
 
 ## Parameter settings
-para.init <- list(theta11=runif(1,max=-1.5,min=-2.5), theta12=runif(1,max=1.5,min=0.5), theta21=runif(1,max=-0.5,min=-1.5))
+para.init <- list(theta11=runif(1,max=-1.5,min=-2.5), theta12=runif(1,max=1.5,min=0.5), 
+                  theta21=runif(1,max=-0.5,min=-1.5))
 para.low <- list(theta11=-7, theta12=-4, theta21=-6)
 para.upp <- list(theta11=3, theta12=6, theta21=4)
 
@@ -129,14 +131,7 @@
 ic2 <- IC(yuima2, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
 ic2
 
-## Ex.1.3 (dXt = (theta21*x)*dt + exp(theta12/2)*dWt)
-mod3 <- setModel(drift="theta21*x", diffusion="exp(theta12/2)")
-samp3 <- setSampling(Terminal=Ter, n = N)
-yuima3 <- setYuima(model=mod3, sampling=samp3)
-ic3 <- IC(yuima3, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
-ic3
-
-
+\dontrun{
 ### Ex.2 (multidimansion case) 
 set.seed(123)
 
@@ -147,24 +142,30 @@
 ## Data generate
 diff.coef.matrix <- matrix(c("beta1+1", "beta3*x1", "-beta2*x1", "beta4+1"), 2, 2)
 drif.coef.vec <- c("alpha1*x1", "alpha2*x2")
-mod <- setModel(drift = drif.coef.vec, diffusion = diff.coef.matrix, state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
+mod <- setModel(drift = drif.coef.vec, diffusion = diff.coef.matrix, 
+                state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
 samp <- setSampling(Terminal = Ter, n = N)
 yuima <- setYuima(model = mod, sampling = setSampling(Terminal = Ter, n = 50*N))
-simu.yuima <- simulate(yuima, xinit = c(1,1), true.parameter = list(alpha1=-2, alpha2=-1, beta1=1, beta2=1, beta3=1, beta4=2), subsampling = samp)
+simu.yuima <- simulate(yuima, xinit = c(1,1), true.parameter = list(alpha1=-2, alpha2=-1, 
+                       beta1=1, beta2=1, beta3=1, beta4=2), subsampling = samp)
 Xt <- matrix(0,(N+1),2)
 for(i in 1:(N+1)){
   Xt[i,] <- simu.yuima at data@original.data[50*(i-1)+1,]
 }
 
 ## Parameter settings
-para.init <- list(alpha1 = runif(1,min=-3,max=-1), alpha2 = runif(1,min=-2,max=0), alpha3 = runif(1,min=-1,max=1), beta1 = runif(1,min=0,max=2), beta2 = runif(1,min=0,max=2), beta3 = runif(1,min=0,max=2), beta4 = runif(1,min=1,max=3))
+para.init <- list(alpha1 = runif(1,min=-3,max=-1), alpha2 = runif(1,min=-2,max=0), 
+                  alpha3 = runif(1,min=-1,max=1), beta1 = runif(1,min=0,max=2), 
+                  beta2 = runif(1,min=0,max=2), beta3 = runif(1,min=0,max=2), 
+                  beta4 = runif(1,min=1,max=3))
 para.low <- list(alpha1 = -5, alpha2 = -5, alpha3 = -5, beta1 = 0, beta2 = 0, beta3 = 0, beta4 = 0)
 para.upp <- list(alpha1 = 5, alpha2 = 5, alpha3 = 5, beta1 = 5, beta2 = 5, beta3 = 5, beta4 = 5)
 
 ## Ex.2.1 
 diff.coef.matrix1 <- matrix(c("beta1+1", "beta3*x1", "-beta2*x1", "beta4+1"), 2, 2)
 drif.coef.vec1 <- c("alpha1*x1", "alpha2*x2+alpha3")
-mod1 <- setModel(drift = drif.coef.vec1, diffusion = diff.coef.matrix1, state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
+mod1 <- setModel(drift = drif.coef.vec1, diffusion = diff.coef.matrix1, 
+                 state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
 samp1 <- setSampling(Terminal=Ter, n = N)
 yuima1 <- setYuima(model=mod1, sampling=samp1)
 ic1 <- IC(yuima1, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
@@ -173,11 +174,13 @@
 ## Ex.2.2 
 diff.coef.matrix2 <- matrix(c("beta1+1", "beta3*x1", "-beta2*x1", "beta4+1"), 2, 2)
 drif.coef.vec2 <- c("alpha1*x1", "alpha2*x2")
-mod2 <- setModel(drift = drif.coef.vec2, diffusion = diff.coef.matrix2, state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
+mod2 <- setModel(drift = drif.coef.vec2, diffusion = diff.coef.matrix2, 
+                 state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
 samp2 <- setSampling(Terminal=Ter, n = N)
 yuima2 <- setYuima(model=mod2, sampling=samp2)
 ic2 <- IC(yuima2, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
 ic2
+}
 
 }
 



More information about the Yuima-commits mailing list