Learn R Programming

Sim.DiffProc (version 2.5)

tho_02diff: Simulation The First Passage Time FPT For Attractive Model for Two-Diffusion Processes V(1) and V(2)

Description

simulation M-sample for the first passage time "FPT" for attractive for 2-diffusion processes V(1)=c(X1(t),X2(t)) and V(2)=c(Y1(t),Y2(t)) or V(1)=c(X1(t),X2(t),X3(t)) and V(2)=c(Y1(t),Y2(t),Y3(t)).

Usage

tho_02diff(N, M, t0, Dt, T = 1, X1_0, X2_0, Y1_0, Y2_0,
           v, K, m, Sigma,Output=FALSE)

Arguments

N
size of the diffusion process V1(t) and V2(t).
M
size of the FPT.
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

  • Random variable tau "FPT".

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 FPT", is defined by : $$tau(V1(t),V2(t)) = inf(t>=0 \ ||D(t)|| <= v="" )$$<="" em=""> with v is the threshold.

See Also

TwoDiffAtra3D, TwoDiffAtra2D, fctgeneral, hist_general, Kern_meth,AnaSimFPT Simulation The First Passage Time FPT For A Simulated Diffusion Process.

Examples

Run this code
tho_02diff(N=500, M=50, t0=0, Dt=0.001, T = 1,
            X1_0=1, X2_0=1,Y1_0=0.5, Y2_0=0.5,v=0.05, 
            K=4, m=0.2, Sigma=0.2)
 summary(FPT)
 hist(FPT,prob=TRUE)
 plot(density(FPT,kernel="gaussian"),col="red")

Run the code above in your browser using DataLab