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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 4 17:26:08 CEST 2010


Author: kamatani
Date: 2010-06-04 17:26:07 +0200 (Fri, 04 Jun 2010)
New Revision: 75

Modified:
   pkg/yuima/man/simulate.Rd
Log:
add an example (CIR)

Modified: pkg/yuima/man/simulate.Rd
===================================================================
--- pkg/yuima/man/simulate.Rd	2010-06-04 03:56:14 UTC (rev 74)
+++ pkg/yuima/man/simulate.Rd	2010-06-04 15:26:07 UTC (rev 75)
@@ -145,6 +145,17 @@
 cor <- simulate(cor)
 plot(cor)
 
+# A non-negative process (CIR process)
+# dXt= a*(c-y)*dt + b*sqrt(Xt)*dWt
+ sq <- function(x){y = 0;if(x>0){y = sqrt(x);};return(y);}
+ model<- setModel(drift="0.8*(0.2-x)",diffusion="0.5*sq(x)",solve.variable=c("x"))
+ T<-10
+ n<-1000
+ sampling <- setSampling(Terminal=T,n=n)
+ yuima<-setYuima(model=model, sampling=sampling)
+ cir<-simulate(yuima,xinit=0.1)
+ plot(cir)
+
 # solve SDEs using Space-discretized Euler-Maruyama method
 v4 <- function(t,x){
   return(0.5*(1-x)*sqrt(t))



More information about the Yuima-commits mailing list