Skip to content

Commit 6d1ba76

Browse files
committed
version 4.8
1 parent abf214a commit 6d1ba76

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ Please send comments, error reports, etc. to the author via the addresses email.
105105
References
106106
----------
107107

108-
1. Guidoum AC, Boukhetala K (2020). "Performing Parallel Monte Carlo and Moment Equations Methods for Itô and Stratonovich Stochastic Differential Systems: R Package Sim.DiffProc". Journal of Statistical Software, 96(2), 1--82. https://doi.org/10.18637/jss.v096.i02
108+
1. Guidoum AC, Boukhetala K (2020). "Performing Parallel Monte Carlo and Moment Equations Methods for Itô and Stratonovich Stochastic Differential Systems: R Package Sim.DiffProc". Journal of Statistical Software, 96(2), 1-82. https://doi.org/10.18637/jss.v096.i02

tests/bridgesde_test.R

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ moment(mod1, at = s , center= FALSE , order = 4)
5353
bconfint(mod1, at =s)
5454

5555
######## 2d
56-
56+
set.seed(1234, kind = "L'Ecuyer-CMRG")
5757
fx <- expression(4*(-1-x) , x)
5858
gx <- expression(0.2 , 0)
5959

@@ -82,13 +82,14 @@ plot2d(mod2,type="n")
8282
lines2d(mod2,col=4)
8383
points2d(mod2,pch=19,cex=0.1)
8484

85+
set.seed(1234, kind = "L'Ecuyer-CMRG")
8586
Sigma <- matrix(c(1, 0.75, 0.75, 1), nrow = 2, ncol = 2)
8687
mod2 <- bridgesde2d(drift=fx,diffusion=gx,corr=Sigma,Dt=0.005,M=10,N=50)
8788
print(mod2)
8889
summary(mod2)
8990

9091
##
91-
92+
set.seed(1234, kind = "L'Ecuyer-CMRG")
9293
mod2 <- bridgesde2d(drift=fx,diffusion=gx,T=5,M=10,N=50,type="str")
9394
print(mod2)
9495
summary(mod2)
@@ -112,6 +113,7 @@ moment(mod2, at = s , center= TRUE , order = 4)
112113
moment(mod2, at = s , center= FALSE , order = 4)
113114
bconfint(mod2, at =s)
114115

116+
set.seed(1234, kind = "L'Ecuyer-CMRG")
115117
Sigma <- matrix(c(1, 0.75, 0.75, 1), nrow = 2, ncol = 2)
116118
mod2 <- bridgesde2d(drift=fx,diffusion=gx,corr=Sigma,Dt=0.005,M=10,N=50,type="str")
117119
print(mod2)
@@ -122,6 +124,7 @@ summary(mod2)
122124
fx <- expression(4*(-1-x)*y, 4*(1-y)*x, 4*(1-z)*y)
123125
gx <- rep(expression(0.2),3)
124126

127+
set.seed(1234, kind = "L'Ecuyer-CMRG")
125128
mod3 <- bridgesde3d(drift=fx,diffusion=gx,x0=c(0,-1,0.5),y=c(0,-2,0.5),M=10,Dt=0.01,N=50)
126129
print(mod3)
127130
summary(mod3)
@@ -142,14 +145,15 @@ plot(mod3)
142145
bconfint(mod3)
143146
plot3D(mod3,display="persp",main="3-dim bridge sde")
144147

148+
set.seed(1234, kind = "L'Ecuyer-CMRG")
145149
Sigma <- matrix(c(1,-0.5,-0.25,-0.5,1,0.95,-0.25,0.95,1),nrow=3,ncol=3)
146150
mod3 <- bridgesde3d(drift=fx,diffusion=gx,corr=Sigma,x0=c(0,-1,0.5),y=c(0,-2,0.5),M=10,Dt=0.01,N=50)
147151
print(mod3)
148152
summary(mod3)
149153

150154
##
151155

152-
156+
set.seed(1234, kind = "L'Ecuyer-CMRG")
153157
mod3 <- bridgesde3d(drift=fx,diffusion=gx,x0=c(0,-1,0.5),y=c(0,-2,0.5),M=10,N=50,type="str")
154158
print(mod3)
155159
summary(mod3)
@@ -172,6 +176,7 @@ moment(mod3, at = s , center= TRUE , order = 4)
172176
moment(mod3, at = s , center= FALSE , order = 4)
173177
bconfint(mod3, at =s)
174178

179+
set.seed(1234, kind = "L'Ecuyer-CMRG")
175180
Sigma <- matrix(c(1,-0.5,-0.25,-0.5,1,0.95,-0.25,0.95,1),nrow=3,ncol=3)
176181
mod3 <- bridgesde3d(drift=fx,diffusion=gx,corr=Sigma,x0=c(0,-1,0.5),y=c(0,-2,0.5),M=10,Dt=0.01,N=50,type="str")
177182
print(mod3)
@@ -182,6 +187,7 @@ summary(mod3)
182187
f <- expression( 2*(1-x) )
183188
g <- expression( 1 )
184189

190+
set.seed(1234, kind = "L'Ecuyer-CMRG")
185191
mod1 <- bridgesde1d(drift=f,diffusion=g,x0=2,y=2,M=1,N=50,Dt=0.05,method="predcorr")
186192
plot(mod1,type="n")
187193
lines(mod1,col=2)
@@ -201,7 +207,7 @@ max(mod1)
201207

202208
fx <- expression(4*(-1-x) , x)
203209
gx <- expression(0.2 , 0)
204-
210+
set.seed(1234, kind = "L'Ecuyer-CMRG")
205211
mod2 <- bridgesde2d(drift=fx,diffusion=gx,M=1,Dt=0.05,N=50)
206212
plot(mod2,union = FALSE)
207213
plot(mod2,type="n")
@@ -223,7 +229,7 @@ max(mod2)
223229

224230
fx <- expression(4*(-1-x), 4*(1-y), 4*(1-z))
225231
gx <- rep(expression(0.2),3)
226-
232+
set.seed(1234, kind = "L'Ecuyer-CMRG")
227233
mod3 <- bridgesde3d(drift=fx,diffusion=gx,M=10,Dt=0.05,N=50,method="predcorr")
228234
plot(mod3,union = FALSE)
229235
plot(mod3,type="n")

tests/snssde_test.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,13 @@ mod3 <- snssde3d(drift=fx,diffusion=gx,N=50,M=1,Dt=0.001)
253253
plot(mod3,type="n")
254254
lines(mod3,col=2)
255255
points(mod3,cex=0.1,pch=19)
256-
plot3D(mod3,display="rgl")
257256
plot3D(mod3)
258257

259258
mod3 <- snssde3d(drift=fx,diffusion=gx,N=50,M=5,Dt=0.001)
260259
plot(mod3,type="n")
261260
lines(mod3,col=2)
262261
points(mod3,cex=0.1,pch=19)
263-
plot3D(mod3,display="rgl")
262+
plot3D(mod3)
264263
plot3D(mod3)
265264

266265
mean(mod3,at = s)

0 commit comments

Comments
 (0)