Learn R Programming

Sim.DiffProc (version 2.5)

TwoDiffAtra3D: Three-Dimensional Attractive Model for Two-Diffusion Processes V(1) and V(2)

Description

simulation 3-dimensional attractive model for 2-diffusion processes V(1)=(X1(t),X2(t),X3(t)) and V(2)=c(Y1(t),Y2(t),Y3(t)).

Usage

TwoDiffAtra3D(N, t0, Dt, T = 1, X1_0, X2_0, X3_0, Y1_0,
              Y2_0, Y3_0, v, K, m, Sigma, Output = FALSE)

Arguments

N
size of process.
t0
initial time.
Dt
time step of the simulation (discretization).
T
final time.
X1_0
initial value of the process X1(t) at time t0.
X2_0
initial value of the process X2(t) at time t0.
X3_0
initial value of the process X3(t) at time t0.
Y1_0
initial value of the process Y1(t) at time t0.
Y2_0
initial value of the process Y2(t) at time t0.
Y3_0
initial value of the process Y3(t) at time t0.
v
threshold. see detail
K
constant K > 0.
m
constant m > 0.
Sigma
constant Sigma > 0.
Output
if Output = TRUE write a Output to an Excel (.csv).

Value

  • data.frame(time,X1(t),X2(t),X3(t),Y1(t),Y2(t),Y3(t),D(t)) and plot of process 3-D.

Details

The 3-dimensional attractive models for 2-diffusion processes V(1)=(X1(t),X2(t),X3(t)) and V(2)=c(Y1(t),Y2(t),Y3(t)) is defined by the Two (02) system for stochastic differential equation three-dimensional : $$dV1(t) = dV2(t)+Mu(m+1)(||D(t)||)*D(t)*dt +Sigma I(3*3)*dW1(t)$$ $$dV2(t) = Sigma*I(3*3)*dW2(t)$$ with: $$D(t) = V1(t) - V2(t)$$ $$Mu(m)(||d||) = -K/||d||^m$$ Where ||.|| is the Euclidean norm and I(3*3) is identity matrix, dW1(t) and dW2(t) are brownian motions independent. D(t)=sqrt((X1(t)^2 - Y1(t)^2)+(X2(t)^2 - Y2(t)^2)+(X3(t)^2-Y3(t)^2)) it is distance between V1(t) and V2(t) . And the random variable tau "first passage time", is defined by : $$tau(V1(t),V2(t)) = inf(t>=0 \ ||D(t)|| <= v="" )$$<="" em=""> with v is the threshold.

See Also

TwoDiffAtra2D, tho_02diff.

Examples

Run this code
TwoDiffAtra3D(N=500, t0=0, Dt=0.001, T = 1, X1_0=0.5, X2_0=0.25,
               X3_0=0.1,Y1_0=-0.5,Y2_0=-1, Y3_0=0.25, v=0.01, K=5,
               m=0.2, Sigma=0.1, Output = FALSE)

Run the code above in your browser using DataLab