Approx.cfpt.density  R Documentation 
Approx.cfpt.density
computes values of the approximate firstpassagetime (f.p.t.) density, for a conditioned problem,
from an object of class “summary.fptl” that contains the information provided by FirstPassageTime Location (FPTL) function.
Approx.cfpt.density(sfptl, variableStep = TRUE, from.t0 = FALSE,
to.T = FALSE, skip = TRUE, n = 250, p = 0.2,
alpha = 1, tol = 1e03, it.max = 50000L)
sfptl 
an object of class “summary.fptl”, a result of applying the 
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, 
to.T 
a logical value indicating whether the approximation should be calculated to the upper end of the
interval considered, 
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 
p 
Ratio of n used to determine the integration step in subintervals

alpha 
Parameter used to determine the integration step in subintervals

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. 
For a diffusion process \{X(t), t_0 \leq t \leq T \}
, the f.p.t. variable,
conditioned to X(t_0) = x_0
, through a continuous boundary S(t)
is defined as
T_{S(t), x_0} = \left\{
\begin{array}{lll}
Inf \ \{ t \geq t_0 \ : \ X(t) > S(t) \mid X(t_0)=x_0 \} & & if \ x_0 < S(t_0) \\[7pt]
Inf \ \{ t \geq t_0 \ : \ X(t) < S(t) \mid X(t_0)=x_0 \} & & if \ x_0 > S(t_0)
\end{array}
\right. .
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,
closedform 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 t_0
, 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 t_{max,i}^+
,
and, if it is almost 0, the application of the numerical algorithm in the subinterval [t_{max,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 t_{max,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 t_{max,i}^+
, and if the cumulative value of the integral is less than 1  tol
the function issues a warning.
The Approx.cfpt.density
function computes and returns an object of class “fpt.density”. It
is a threecomponent list:
x 
a sequence of suitable time instants in 
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 
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.
Patricia RománRomán, Juan J. SerranoPérez and Francisco TorresRuiz.
Buonocore, A., Nobile, A.G. and Ricciardi, L.M. (1987) A new integral equation for the evaluation of firstpassagetime probability densities. Adv. Appl. Probab., 19, 784–800.
Román, P., Serrano, J. J., Torres, F. (2008) Firstpassagetime location function: Application to determine firstpassagetime densities in diffusion processes. Comput. Stat. Data Anal., 52, 4132–4146.
P. RománRomán, J.J. SerranoPérez, F. TorresRuiz. (2012) An R package for an efficient approximation of firstpassagetime densities for diffusion processes based on the FPTL function. Applied Mathematics and Computation, 218, 8408–8428.
P. RománRomán, J.J. SerranoPérez, F. TorresRuiz. (2014) More general problems on firstpassage times for diffusion processes: A new version of the fptdApprox R package. Applied Mathematics and Computation, 244, 432–446.
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”.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.