Learn R Programming

fptdApprox (version 2.5)

is.fpt.density: Testing for objects of class “fpt.density”

Description

is.fpt.density tests if its argument is an object of class “fpt.density”.

Usage

is.fpt.density(obj)

Value

is.fpt.density returns TRUE or FALSE depending on whether its argument is an object of class “fpt.density” or not.

An object of class “fpt.density” is a three-component list:

x

a sequence of suitable time instants in \([t_0, \ T]\) according to the arguments in the function call.

y

the approximate f.p.t. density function values on the x sequence for the unconditioned or conditioned problem at hand.

y.x0

NULL for a conditioned f.p.t. problem or a matrix with the values, by columns, of the approximate f.p.t. densities conditioned to each considered value \(x_0\) of the initial ditribution for an unconditioned f.p.t. problem.


It also includes six additional attributes. For more details, see the values of Approx.cfpt.density and Approx.fpt.density functions.

Arguments

obj

an R object to be tested.

Author

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

References

P. Román-Román, J.J. Serrano-Pérez, F. Torres-Ruiz. (2012) An R package for an efficient approximation of first-passage-time densities for diffusion processes based on the FPTL function. Applied Mathematics and Computation, 218, 8408--8428.

P. Román-Román, J.J. Serrano-Pérez, F. Torres-Ruiz. (2014) More general problems on first-passage times for diffusion processes: A new version of the fptdApprox R package. Applied Mathematics and Computation, 244, 432--446.

Examples

Run this code
## Testing fpt.density objects
Lognormal <- diffproc(c("m*x","sigma^2*x^2","dnorm((log(x)-(log(y)+(m-sigma^2/2)*(t-s)))/(sigma*sqrt(t-s)),0,1)/(sigma*sqrt(t-s)*x)", "plnorm(x,log(y)+(m-sigma^2/2)*(t-s),sigma*sqrt(t-s))")) ; 
b <- "4.5 + 4*t^2 + 7*t*sqrt(t)*sin(6*sqrt(t))" ; y <- FPTL(dp = Lognormal, t0 = 0, T = 18, x0 = 1, S = b, list(m = 0.48, sigma = 0.07)) ; yy <- summary(y);
yyy <- Approx.cfpt.density(yy); yyy.cp <- Approx.fpt.density(dp = Lognormal, t0 = 0, T = 18, id = 1, S = "4.5 + 4*t^2 + 7*t*sqrt(t)*sin(6*sqrt(t))", env = list(m = 0.48, sigma = 0.07))
## Continuing the Approx.cfpt.density example:
is.fpt.density(yyy)

## Continuing the Approx.fpt.density example:
is.fpt.density(yyy.cp)
if (FALSE) {
is.fpt.density(yyy.ucp)}

Run the code above in your browser using DataLab