R: Approximating First-Passage-Time Densities for Conditioned...
Approx.cfpt.density
R Documentation
Approximating First-Passage-Time Densities for Conditioned Problems
Description
Approx.cfpt.density computes values of the approximate first-passage-time (f.p.t.) density, for a conditioned problem,
from an object of class “summary.fptl” that contains the information provided by First-Passage-Time Location (FPTL) function.
Usage
Approx.cfpt.density(sfptl, variableStep = TRUE, from.t0 = FALSE,
to.T = FALSE, skip = TRUE, n = 250, p = 0.2,
alpha = 1, tol = 1e-03, it.max = 50000L)
Arguments
sfptl
an object of class “summary.fptl”, a result of applying the summary.fptl method to an object
of class “fptl”.
variableStep
a logical value indicating whether a variable integration step is used.
from.t0
a logical value indicating whether the approximation should be calculated from the lower end of the
interval considered, t0, specified in the sfptl object.
to.T
a logical value indicating whether the approximation should be calculated to the upper end of the
interval considered, T, specified in the sfptl object.
skip
a logical value indicating whether the intervals at which the FPTL function is near zero could be
avoided.
n
Number of points used to determine the integration step in subintervals [t[i]*, tmax[i]^+]i=1,..., m, from interesting instants provided by the FPTL function.
p
Ratio of n used to determine the integration step in subintervals
[tmax[i]^+, t[i+1]*], i=1,..., m, [t0, t[1]*] and
[tmax[m]^+, T].
alpha
Parameter used to determine the integration step in subintervals
[tmax[i]^+, t[i+1]*], i=1,..., m, [t0, t[1]*] and
[tmax[m]^+, T], in order to reduce the computational cost of approximating the f.p.t. density function
in those cases where t[i+1]* - tmax[i]^+ >> tmax[i]^- - t[i]*,
for some i, t[1]* - t0 >> tmax[1]^- - t[1]* or
T - tmax[m]^+ >> tmax[m]^- - t[m]*, respectively.
tol
If the cumulative integral of the approximation is greater than or equal to 1 - tol the algorithm is stopped.
it.max
If the number of iterations required for the approximation process is greater than it.max, the function asks for permission to continue.
Details
For a diffusion process {X(t), t0 ≤ t ≤ T}, the f.p.t. variable,
conditioned to X(t0) = x0, through a continuous boundary S(t) is defined as
T = Inf{ t ≥ t0 : X(t) > S(t) | X(t0) = x0 } ,
if x0 < S(t0), and
T = Inf{ t ≥ t0 : X(t) < S(t) | X(t0) = x0 } ,
if x0 > S(t0).
Its density function is the solution to a Volterra integral equation of the second kind. The kernel of this equation depends
on the infinitesimal moments of the process, the transition probability density function and the boundary.
Nevertheless, and apart from some particular processes and boundaries,
closed-form solutions for the integral equation are not available. For this reason,
in the cases without explicit solutions, numerical procedures are required. That is the situation
considered here and the numerical procedure implemented by the Approx.fpt.density function is the one
proposed by Buonocore et al. (1987), based on the composite trapezoid method.
The Approx.cfpt.density function computes efficiently the approximate f.p.t. density by
using the information provided by the FPTL function contained in the
sfptl object. See the function summary.fptl for details.
By default the function does not compute the approximate f.p.t. density
from the time instant t0, but from a more suitable time instant t[1]*
provided by the FPTL function. It also uses a variable integration step.
The function makes an internal call to Integration.Steps function in order to determine the subintervals and
integration steps to be used in the application of the numerical algorithm according to the variableStep,
from.t0, to.T, n, p and alpha arguments.
In addition, if skip = TRUE, the function checks the approximate density value for each tmax[i]^+,
and, if it is almost 0, the application of the numerical algorithm in the subinterval [tmax[i]^+, t[i+1]*]
is avoided, and then continued from instant t[i+1]* considering a zero value of the approximate
density.
Similarly, if to.T = FALSE, the function checks the cumulative value of the integral for each tmax[i]^+
provided by the FPTL function and, if it is greater than or equal to 1 - tol, the numerical algorithm is stopped. In any case,
the algorithm is stopped in the final tmax[i]^+, and if the cumulative value of the integral is less than 1 - tol
the function issues a warning.
Value
The Approx.cfpt.density function computes and returns an object of class “fpt.density”. It
is a three-component list:
x
a sequence of suitable time instants in [t0, T] according to the arguments in the function call.
y
the approximate conditioned f.p.t. density function values on the x sequence.
y.x0
NULL (for consistency with the object of class “fpt.density” that produces the Approx.fpt.density function).
It also includes six additional attributes:
Call
the unevaluated function call, substituting each name in this call by its value when
the latter has length 1.
Steps
matrix of subintervals and integration steps to consider for computing
the approximate conditioned f.p.t. density.
cumIntegral
vector of the values of the cumulative integral of the
approximation for each subinterval considered.
skips
a list that contains, for each subinterval, the value 1 if the application of the
numerical algorithm has been avoided or integer(0) otherwise.
CPUTime
matrix of user and system times, by columns, required to approximate
the density for each subinterval considered, by rows.
summary.fptl
the object used as sfptl argument in the function call.
x is the vector result of the concatenation of the sequences of equally spaced values in the suitable subintervals
determined by the Integration.Steps function.
Buonocore, A., Nobile, A.G. and Ricciardi, L.M. (1987) A new integral equation for the evaluation of
first-passage-time probability densities. Adv. Appl. Probab., 19, 784–800.
Román, P., Serrano, J. J., Torres, F. (2008) First-passage-time location function: Application to determine first-passage-time densities in diffusion processes. Comput. Stat. Data Anal., 52, 4132–4146.
summary.fptl to locate the f.p.t. variable and create objects of class “summary.fptl”.
is.fpt.density to test for objects of class “fpt.density”.
print.fpt.density to show objects of class “fpt.density”.
report.fpt.density to generate a report.
plot.fpt.density for graphical display.
FPTL to evaluate the FPTL function and create objects of class “fptl”.
Examples
## Continuing the summary.fptl(.) example:
## Making an efficient approximation of the f.p.t. density
## (optimal variable integration steps and small computational cost)
yyy <- Approx.cfpt.density(yy)
yyy
zzz <- Approx.cfpt.density(zz)
zzz
## Making a less efficient approximation of the f.p.t. density
## (optimal fixed integration step but high computational cost related to
## the efficient approximation)
## Not run:
yyy1 <- Approx.cfpt.density(yy, variableStep = FALSE, from.t0 = TRUE, to.T =
TRUE, skip = FALSE)
yyy1
## End(Not run)