MOL.passage: Approximate the First Passage Time Density of a Two-Barrier...

Description Usage Arguments Value Interface Warnings Note Author(s) References See Also Examples

Description

For scalar diffusions with drift mu=function(X){} and diffusion sig=function(X){}, moving in relation to lower and upper bounds limits[1] and limits[2] respectively, MOL.passage() approximates a solution to the partial differential equation (PDE) that governs the evolution of the survaval distribution of the first passage time density via the method of lines (MOL).

Usage

1
MOL.passage(Xs, t, limits, N, delt, mu, sig, desc = 1)

Arguments

Xs

Starting/Initial value for the diffusion process (see note [1]).

t

Value (>0) giving the terminal point for the transition horizon (the final time at which to evaluate the transition density).

limits

Limits for the spatial nodes of the lattice. These limits now represent the limits in the spatial domain (see note [2]).

N

The number of nodes in the spatial domain at which to evaluate the transitional density. Increase N for more accurate approximations (see note [3] and warning [2]).

delt

Step size for the time domain of the lattice (see note [4]).

mu

Optional (if drift and diffusion coefficients are already defined) arguments giving the drift and diffusion coefficients as text expressions (See Interface below).

sig

Optional (if drift and diffusion coefficients are already defined) arguments giving the drift and diffusion coefficients as text expressions (See Interface below).

desc

The type of discretization used (see note [5]).

Value

surface

A matrix giving the approximate survival probability over time for all starting values contained in the discretization of the interval enclosed by limits.

density

A vector containing the approximate first passage time density for trajectories starting at Xs (see note [i]).

time

A vector of time nodes at which the approximation was evaluated.

Interface

MOL.passage uses a function-input interface whereby the drift and diffusion components of the time-homogeneous stochastic differential equation (SDE):

dX_t = mu(X_t)dt+sigma(X_t)dW_t,

are defined as R-functions in the current workspace. That is by defining the drift and diffusion components

mu=function(X){some expression i.t.o. X}

sig=function(X){some expression i.t.o. X}

further analysis may be conducted by calling the function MOL.passage().

Warnings

Warning [1]:

Note

Note [1]: If the initial value Xs does not fall on one of the lattice nodes, then the first passage time density is calculated by linearly interpolating between approximations at the two nearest lattice nodes.

Note [2]: Note that that enough nodes, N, are needed in order to generate a sufficiently accurate approximation, especially when limits[1] and limits[2] are far apart.

Note [3]: Increasing N will likely require smaller delt, thus increasing computation time. For some problems, slight increases in N will require much smaller delt.

Note [4]: delt is used as the step size for a 10(8)-th order Runge-Kutta method for solving the resulting system of ODEs. Note again the inter-play between N and delt (see note [3]).

Note [5]: When one of the limits is sufficiently far away to not be accessible within the provided time-horizon, instabilities may occur and an alternative discretization may be required in order to ensure smooth operation. Possible values are desc = 1 (close limits), desc = 2 (limits[1] is inaccessible) and desc = 3 (limits[2] is inaccessible).

Author(s)

Etienne A.D. Pienaar etiennead@gmail.com

References

Hamdi, S., Schiesser, W. E. and Griffiths, G. W. 2007 Method of lines. Scholarpedia, 2(7):2859. Revision #124335.

Feagin, T. 2007 A tenth-order Runge-Kutta method with error estimate. In Proceedings of the IAENG Conf. on Scientifc Computing.

See Also

MOL.density, BiMOL.density.

Examples

1
2
3
4
5
6
7
8
#===============================================================================

 # For detailed notes and examples on how to use the MOL.passage() function, see
 # the following vignette:

 RShowDoc('Part_3_First_Passage_Times',type='html','DiffusionRimp')

#===============================================================================

eta21/DiffusionRimp documentation built on May 16, 2019, 8:54 a.m.