MoTBFs (version 1.4.1)

integralMoTBF: Integrating MoTBFs

Description

Compute the integral of a one-dimensional mixture of truncated basis function over a bounded or unbounded interval.

Usage

integralMoTBF(fx, min = NULL, max = NULL)

Arguments

fx

An object of class "motbf".

min

The lower integration limit. By default it is NULL.

max

The upper integration limit. By default it is NULL.

Value

integralMoTBF() returns either the indefinite integral of the MoTBF function, which is also an object of class "motbf", or the definite integral, wich is a "numeric" value.

Details

If the limits of the interval, min and max are NULL, then the output is the expression of the indefinite integral. If only 'min' contains a numeric value, then the expression of the integral is evaluated at this point.

See Also

univMoTBF, integralMOP and integralMTE

Examples

Run this code
# NOT RUN {
## 1. EXAMPLE
X <- rexp(1000)
Px <- univMoTBF(X, POTENTIAL_TYPE="MOP")
integralMoTBF(Px)
integralMoTBF(Px, 1.2)
integralMoTBF(Px, min(X), max(X))

## 2. EXAMPLE
X <- rnorm(1000)
Px <- univMoTBF(X, POTENTIAL_TYPE="MOP")
iP <- integralMoTBF(Px); iP
plot(iP, xlim=range(X))
integralMoTBF(Px, 0.2)
integralMoTBF(Px, min(X), max(X))

## 3. EXAMPLE
X <- rchisq(1000, df = 3)
Px <- univMoTBF(X, POTENTIAL_TYPE="MTE")
integralMoTBF(Px)
integralMoTBF(Px, 1)
integralMoTBF(Px, min(X), max(X))

# }
# NOT RUN {
## 4. EXAMPLE
Px <- "1+x+5"
class(Px)
integralMoTBF(Px)
## Error in integralMoTBF(Px): "fx is not an 'motbf' function."
# }

Run the code above in your browser using DataLab