growth.intervals: Studying the Growth of a Vector In fptdApprox: Approximation of First-Passage-Time Densities for Diffusion Processes

 growth.intervals R Documentation

Studying the Growth of a Vector

Description

For the vector of values resulting from the evaluation of a function, this function determines the positions of the values between which the vector grows.

Usage

``````growth.intervals(x, y, zeroSlope = 0.01)
``````

Arguments

 `x` a vector of values. `y` the vector of the corresponding values of a function for the `x` vector. `zeroSlope` maximum slope (in degrees) required to consider that a growing function is constant.

Details

The `growth.intervals` function ignores the pairs of values between which the vector `y` starts and stops growing if the slope is less than `zeroSlope`.

Value

This function returns NULL if the vector `y` is not growing. Otherwise, the function computes a matrix of indexes with two columns. The first column contains the positions of the values from which the vector `y` starts growing and the second column those at which the vector `y` stops growing.

Author(s)

Patricia Román-Román, Juan J. Serrano-Pérez and Francisco Torres-Ruiz.

Examples

``````u <- seq(0, 5, length = 200)
v <- sin(u)
w <- growth.intervals(u, v)
w

plot(u, v, type = "l", las = 1)
abline(v = u[as.vector(w)])

## Continuing the FPTL(.) examples:

growth.intervals(y\$x, y\$y)
growth.intervals(y\$x, y\$y, zeroSlope = 0.001)
``````

fptdApprox documentation built on Nov. 2, 2023, 5:07 p.m.