Integration.Steps  R Documentation 
According to the FirstPassageTime Location (FPTL) function and the arguments in the function call, this function calculates suitable subintervals and integration steps in order to approximate the firstpassagetime (f.p.t.) density.
Integration.Steps(sfptl, variableStep = TRUE, from.t0 = FALSE,
to.T = FALSE, n = 250, p = 0.2, alpha = 1)
sfptl 
an object of class “summary.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, 
to.T 
a logical value indicating whether the approximation should be calculated to the upper end of the
interval considered, 
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

Based on the information provided by the FPTL function contained in the sfptl
object, this function computes and returns
suitable subintervals and integration steps in order to approximate the density
function of the f.p.t. variable according to the other arguments in the function call.
When the sfptl
object is of length greater than 1, it comes from an unconditioned f.p.t. problem. Each component is associated with
the same f.p.t. problem conditioned on different values of the initial distribution
(equally spaced in the range of the distribution). Let x_{0,j}
, j=1, \ldots, N
, these values. For each initial value
x_{0,j}
let t_{i,j}^*
, t_{max,i,j}^
and t_{max,i,j}^+
, i=1,\ldots \ m_j
,
the interesting time instants provided by the FPTL function and stored in the instants
component of the jth list in the sfptl
object.
Then, the time instants \{t_{i,j}, i=1, 2, \ldots, 2m_j \}
, where
t_{i,j} = \left\{ \begin{array}{ll} t_{(i+1)/2, \, j}^* & for \ i \ odd \\[7pt] t_{max, \, i/2, \thinspace j}^+ & for \ i \ even \end{array}
\right. ,
provide a suitable partition of interval [t_0, T]
to approximate the f.p.t density
for the fixed value x_{0,j}
of the initial distribution.
If the sfptl
object is of length 1, it comes from a conditioned f.p.t. problem. In this case we denote the interesting time
instants provided by the FPTL function and stored in the sfptl
object by t_{i,1}^*
, t_{max,i,1}^
and t_{max,i,1}^+
.
In what follows, \lceil x \rceil
is the integer part of x
.
For each list in the sfptl
object the function computes
h_{i,j} = \displaystyle{\frac{t_{max,i,j}^{+}  \, t_{i,j}^*}{n_{i,j}}} , i=1, \ldots, m_j,
where
n_{i,j} = \lceil n \, k_{i,j} \rceil
and
k_{i,j} = \displaystyle{\frac{t_{max,i,j}^+  t_{i,j}^{*}}{t_{max,i,j}^{}  \, t_{i,j}^*}} \ .
If variableStep = TRUE
, for 0 < p
and \alpha \leq 1
, also computes
h_{i,j}^* = \displaystyle{\frac{t_{i+1,j}^*  t_{max,i,j}^+}{n_{i,j}^*}} , i=1, \ldots, m_j1,
where
n_{i,j}^* = \left\{ \begin{array}{cc}
\lceil n \, p \, k_{i,j}^* \rceil & if \ k_{i,j}^* \leq 1 \\[7pt]
\lceil n \, p \, {k_{i,j}^{*}}^{\alpha} \rceil & if \ k_{i,j}^* > 1
\end{array}
\right.
with
k_{i,j}^* = \displaystyle{\frac{t_{i+1,j}^*  \, t_{max,i,j}^+}{t_{max,i,j}^{}  \, t_{i,j}^*}} \ .
If h_{i,j}^* < h_{i,j}
, we then set t_{max,i,j}^+
equal to t_{i+1,j}^*
and h_{i,j}
is recalculated.
h_{0,j}^* = \displaystyle{\frac{t_{1,j}^*  t_0}{n_{0,j}^*}} ,
where
n_{0,j}^* = \left\{ \begin{array}{cc}
\lceil n \, p \, k_{0,j}^* \rceil & if \ k_{0,j}^* \leq 1 \\[7pt]
\lceil n \, p \, {k_{0,j}^{*}}^{\alpha} \rceil & if \ k_{0,j}^* > 1
\end{array}
\right.
with
k_{0,j}^* = \displaystyle{\frac{t_{1,j}^*  \, t_0}{t_{max,1,j}^{}  \, t_{1,j}^*}} \ ,
when the sfptl
object is of length 1 and from.t0 = TRUE
, or the sfptl
object is of length greater than 1.
If h_{0,j}^* < h_{1,j}
, we then set t_{1,j}^*
equal to t_0
and h_{1,j}
is recalculated.
h_{m_j,j}^* = \displaystyle{\frac{T  \, t_{max,m_j,j}^+}{n_{m_j,j}^*}} ,
where
n_{m_j,j}^* = \left\{ \begin{array}{cc}
\lceil n \, p \, k_{m_j,j}^* \rceil & if \ k_{m_j,j}^* \leq 1 \\[7pt]
\lceil n \, p \, {k_{m_j,j}^{*}}^{\alpha} \rceil & if \ k_{m_j,j}^* > 1
\end{array}
\right.
with
k_{m_j,j}^* = \displaystyle{\frac{T  \, t_{max,m_j,j}^+}{t_{max,m_j,j}^{}  \, t_{m_j,j}^*}} \ ,
when the sfptl
object is of length 1 and to.T = TRUE
, or the sfptl
object is of length greater than 1.
If h_{m_j,j}^* < h_{m_j,j}
, we then set t_{max,m_j,j}^+
equal to T
and h_{m_j,j}
is recalculated.
p \geq 0.1
and 0.75 \leq \alpha \leq 1
are recommended; otherwise, some integration steps can be excessively large.
If the sfptl
object is of length 1 (conditioned f.p.t. problem), the suitable subintervals and integration steps that the function provides are:
If variableStep = TRUE
,
h_{i,1}
in subintervals [t_{i,1}^*, t_{max,i,1}^+]
, i=1, \ldots, m_1
.
h_{i,1}^*
in subintervals [t_{max,i,1}^+, t_{i+1,1}^*]
,
i=1, \ldots, m_11
.
In these subintervals is possible to avoid applying the numerical algorithm to approximate the f.p.t. density provided that the
value of the approximate density at the time instant t_{max,i,1}^+
is almost 0.
h_{0,1}^*
in subinterval [t_0, t_{1,1}^*]
, if from.t0 = TRUE
.
h_{m_1,1}^*
in subinterval [t_{max,m_1,1}^{+}, T]
, if to.T = TRUE
.
If variableStep = FALSE
the function computes
h = min \left\{ h_{i,1} \ , \ i=1, \ldots, m_1 \right\} \thinspace .
Then
If from.t0 = FALSE
and to.T = FALSE
, h
is readjusted to exactly split the interval [t_{1,1}^*, t_{max,m_1,1}^+]
.
If from.t0 = TRUE
and to.T = FALSE
, h
is readjusted to exactly split the interval [t_0, t_{max,m_1,1}^+]
.
If from.t0 = FALSE
and to.T = TRUE
, h
is readjusted to exactly split the interval [t_{1,1}^*, T]
.
If from.t0 = TRUE
and to.T = TRUE
, h
is readjusted to exactly split the interval [t_0, T]
.
h
is a suitable fixed integration step in subintervals [t_{i,1}^*, t_{max,i,1}^+]
, i=1, \ldots, m_1
, and
[t_{max,i,1}^+,
t_{i+1,1}^*]
, i=1, \ldots, m_11
;
in subintervals [t_0, t_{1,1}^*]
if from.t0 = TRUE
, and in
[t_{max,m_1,1}^{+}, T]
if to.T = TRUE
. The endpoints of such subintervals
are readjusted according to this integration step.
If the sfptl
object is a list of length greater than 1 (unconditioned f.p.t problem), a common partition of
the interval [t_0, T]
is calculated from the suitable partitions of this interval for each
fixed value of the initial distribution.
Let, in unified form, H_{r,j}
, r=1, \ldots, 2m_j+1
, the suitable integration steps
(calculated for each j
in similar manner to the case of the sfptl
object is of length 1) in
subintervals I_{r,j} = [t_{r1,j}, t_{r,j}]
, with t_{0,j}=t_0
and
t_{2m_j+1,j} = T
, j=1, \ldots, N
.
Then, the ordered values of all time instants in the suitable partitions,
t_{(1)}, \ldots, t_{(M)}
, provide a common suitable partition of the interval [t_0, T]
in subintervals [t_{(i1)}, t_{(i)}]
, i=1, \ldots, M \negthinspace + \negthinspace 1
,
where t_{(0)} = t_0
and t_{(M \negthinspace + \negthinspace 1)} = T
.
For this partition, the function computes
H_{i} = min \, \{ H_{r,j} : j=1, \ldots, N, \ and \ [t_{(i1)}, t_{(i)}] \subseteq I_{r,j} \} , \ i=2, \ldots, M.
H_{1} = min \, \{ H_{r,j} : j=1, \ldots, N, \ and \ [t_0, t_{(1)}] \subseteq I_{r,j} \}
, if from.t0 = TRUE
.
H_{M \negthinspace + \negthinspace 1} = min \, \{ H_{r,j} : j=1, \ldots, N, \ and \ [t_{(M)}, T] \subseteq I_{r,j} \}
, if to.T = TRUE
.
Thus,
If variableStep = TRUE
, the suitable subintervals and integrations steps that the function provides are
H_i
in subintervals [t_{(i1)}, t_{(i)}]
, i=2, \ldots, M
.
H_1
in subinterval [t_0, t_{(1)}]
, if from.t0 = TRUE
.
H_{M \negthinspace + \negthinspace 1}
in subinterval [t_{(M)}, T]
, if to.T = TRUE
.
Each integration step is readjusted to exactly split the corresponding subinterval.
If variableStep = FALSE
, a suitable fixed integration step for any subinterval [t_{(i1)}, t_{(i)}]
is
h = min \left\{ H_{i} : i=1, \ldots, M \negthinspace + \negthinspace 1 \right\}.
In this case it is not possible to avoid applying the approximation algorithm in [t_{(i1)}, t_{(i)}] \ \forall \ i=1, \ldots, M \negthinspace + \negthinspace 1
.
Then
If from.t0 = FALSE
and to.T = FALSE
, h
is readjusted to exactly split the interval [t_{(1)}, t_{(M)}]
.
If from.t0 = TRUE
and to.T = FALSE
, h
is readjusted to exactly split the interval [t_0, t_{(M)}]
.
If from.t0 = FALSE
and to.T = TRUE
, h
is readjusted to exactly split the interval [t_{(1)}, T]
.
If from.t0 = TRUE
and to.T = TRUE
, h
is readjusted to exactly split the interval [t_0, T]
.
h
is a suitable fixed integration step in subintervals [t_{(i1)}, t_{(i)}]
, i=2, \ldots, M
,
in subintervals [t_0, t_{(1)}]
if from.t0 = TRUE
, and in
[t_{(M)}, T]
if to.T = TRUE
. The endpoints of such subintervals
are readjusted according to this integration step.
A twocomponent list:
H 
A matrix of subintervals and integrations steps that we must consider in order to approximate the f.p.t.
density according to the information contained in the 
skip 
A list of logical vectors indicating, for each subinterval, the values of the initial distribution for which we must check whether it is possible to avoid applying the numerical algorithm. 
Patricia RománRomán, Juan J. SerranoPérez and Francisco TorresRuiz.
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.
Approx.fpt.density
to approximate f.p.t. densities from objects of class “summary.fptl” and create objects of class “fpt.density”.
summary.fptl
to locate the f.p.t. variable and create objects of class “summary.fptl” from objects of class
“fptl”.
FPTL
to evaluate the FPTL function and create objects of class “fptl”.
## Continuing the summary.fptl(.) example:
Integration.Steps(yy)
Integration.Steps(yy, from.t0 = TRUE)
Integration.Steps(yy, to.T = TRUE, n = 100, p = 0.25)
Integration.Steps(zz)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.