fptsde3d for simulate first-passage-time (f.p.t) in 3-dim stochastic differential equations.fptsde3d(N, ...)
## S3 method for class 'default':
fptsde3d(N = 100, M = 10, x0 = 0, y0 = 0, z0 = 0, t0 = 0, T = 1, Dt, c = 0.5,
driftx, diffx, drifty, diffy, driftz, diffz, alpha = 0.5, mu = 0.5,
type = c("ito", "str"), method = c("euler", "milstein", "predcorr",
"smilstein", "taylor", "heun", "rk1", "rk2", "rk3"), ...)
## S3 method for class 'fptsde3d':
summary(object, \dots)
## S3 method for class 'fptsde3d':
mean(x, \dots)
## S3 method for class 'fptsde3d':
median(x, \dots)
## S3 method for class 'fptsde3d':
quantile(x, \dots)
## S3 method for class 'fptsde3d':
kurtosis(x, \dots)
## S3 method for class 'fptsde3d':
skewness(x, \dots)
## S3 method for class 'fptsde3d':
moment(x, order = 2, \dots)
## S3 method for class 'fptsde3d':
bconfint(x, level=0.95, \dots)t0.t0.t0.missing a default $\Delta t = \frac{T-t_{0}}{N}$.expression of four variables t, x, y and z for process $X_t$.expression of four variables t, x, y and z for process $X_t$.expression of four variables t, x, y and z for process $Y_t$.expression of four variables t, x, y and z for process $Y_t$.expression of four variables t, x, y and z for process $Z_t$.expression of four variables t, x, y and z for process $Z_t$.alpha of the predictor-corrector scheme; the default alpha = 0.5.mu of the predictor-corrector scheme; the default mu = 0.5.method = "euler"; see snssde3d."fptsde3d".fptsde3d returns an object inheriting from class "fptsde3d".fptsde3d returns a random variables $\tau_{c}(x)$, $\tau_{c}(y)$ and $\tau_{c}(z)$
"first passage time" for $(X(t),Y(t),Z(t))$, defined by :
$$\tau_{c}(x) = { t \geq 0 ; X_{t} \geq c },\quad if \quad (x_{0} < c)$$
$$\tau_{c}(y) = { t \geq 0 ; Y_{t} \geq c },\quad if \quad (y_{0} < c)$$
$$\tau_{c}(z) = { t \geq 0 ; Z_{t} \geq c },\quad if \quad (z_{0} < c)$$
and
$$\tau_{c}(x) = { t \geq 0 ; X_{t} \leq c },\quad if \quad (x_{0} > c)$$
$$\tau_{c}(y) = { t \geq 0 ; Y_{t} \leq c },\quad if \quad (y_{0} > c)$$
$$\tau_{c}(z) = { t \geq 0 ; Z_{t} \leq c },\quad if \quad (z_{0} > c)$$
with $c$ is a fixed boundary or barrier.fptsde1d for simulation fpt in sde 1-dim. FPTL in package ## Example :
## dX(t) = W2(t) dt + W3(t) * dW1(t)
## dY(t) = dW2(t) and dZ(t) = dW3(t)
## x0 = y0 = = z0 = 0, and barrier c = 0.5.
## W1(t), W2(t) and W3(t) three independent Brownian motion
fx <- expression(y)
gx <- expression(z)
fy <- expression(0)
gy <- expression(1)
fz <- expression(0)
gz <- expression(1)
res3 <- fptsde3d(driftx=fx,diffx=gx,drifty=fy,diffy=gy,driftz=fz,diffz=gz,N=1000,M=50,c=0.5)
res3
summary(res3)
bconfint(res3,level=0.95)
moment(res3,order=c(2,3,4,5))
X <- cbind(res3$tau_x,res3$tau_y,res3$tau_z)
## library(sm)
## sm.density(X,display="rgl")Run the code above in your browser using DataLab