Skip to content

Commit 3e21f23

Browse files
committed
Version 4.7
1 parent f225cf7 commit 3e21f23

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/bridgesde_test.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ plot2d(mod2,type="n")
8282
lines2d(mod2,col=4)
8383
points2d(mod2,pch=19,cex=0.1)
8484

85+
Sigma <- matrix(c(1, 0.75, 0.75, 1), nrow = 2, ncol = 2)
86+
mod2 <- bridgesde2d(drift=fx,diffusion=gx,corr=Sigma,Dt=0.005,M=10,N=50)
87+
8588
##
8689

8790
mod2 <- bridgesde2d(drift=fx,diffusion=gx,T=5,M=10,N=50,type="str")
@@ -107,6 +110,9 @@ moment(mod2, at = s , center= TRUE , order = 4)
107110
moment(mod2, at = s , center= FALSE , order = 4)
108111
bconfint(mod2, at =s)
109112

113+
Sigma <- matrix(c(1, 0.75, 0.75, 1), nrow = 2, ncol = 2)
114+
mod2 <- bridgesde2d(drift=fx,diffusion=gx,corr=Sigma,Dt=0.005,M=10,N=50,type="str")
115+
110116
######## 3d
111117

112118
fx <- expression(4*(-1-x)*y, 4*(1-y)*x, 4*(1-z)*y)
@@ -132,6 +138,9 @@ plot(mod3)
132138
bconfint(mod3)
133139
plot3D(mod3,display="persp",main="3-dim bridge sde")
134140

141+
Sigma <- matrix(c(1,-0.5,-0.25,-0.5,1,0.95,-0.25,0.95,1),nrow=3,ncol=3)
142+
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)
143+
135144
##
136145

137146

@@ -157,6 +166,10 @@ moment(mod3, at = s , center= TRUE , order = 4)
157166
moment(mod3, at = s , center= FALSE , order = 4)
158167
bconfint(mod3, at =s)
159168

169+
Sigma <- matrix(c(1,-0.5,-0.25,-0.5,1,0.95,-0.25,0.95,1),nrow=3,ncol=3)
170+
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")
171+
172+
160173
#############################
161174

162175
f <- expression( 2*(1-x) )

0 commit comments

Comments
 (0)