Learn R Programming

Sim.DiffProc (version 2.5)

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

Description

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

Usage

TwoDiffAtra2D(N, t0, Dt, T = 1, X1_0, X2_0, Y1_0, Y2_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.
Y1_0
initial value of the process Y1(t) at time t0.
Y2_0
initial value of the process Y2(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),Y1(t),Y2(t),D(t)) and plot of process 2-D.

Details

The 2-dimensional attractive models for 2-diffusion processes V(1)=(X1(t),X2(t)) and V(2)=c(Y1(t),Y2(t)) is defined by the Two (02) system for stochastic differential equation Two-dimensional : $$dV1(t) = dV2(t)+Mu(m+1)(||D(t)||)*D(t)*dt +Sigma I(2*2)*dW1(t)$$ $$dV2(t) = Sigma*I(2*2)*dW2(t)$$ with: $$D(t) = V1(t) - V2(t)$$ $$Mu(m)(||d||) = -K/||d||^m$$ Where ||.|| is the Euclidean norm and I(2*2) 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)) 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

TwoDiffAtra3D, tho_02diff.

Examples

Run this code
TwoDiffAtra2D(N=2000, t0=0, Dt=0.001, T = 1, X1_0=0.5, X2_0=1,
               Y1_0=-0.5, Y2_0=-1,v=0.05, K=2, m=0.2, 
               Sigma=0.1, Output = FALSE)

Run the code above in your browser using DataLab