MoTBF-Distribution {MoTBFs} | R Documentation |
Random generation for MoTBF distributions
Description
Random generation for mixtures of truncated basis functions defined in a specific domain. The inverse transform method is used.
Usage
rMoTBF(size, fx, domain = NULL)
inversionMethod(size, fx, domain = NULL, data = NULL)
Arguments
size |
A non-negative integer indicating the number of records to generate. |
fx |
An object of class |
domain |
A |
data |
A |
Value
rMoTBF()
returns a "numeric"
vector containing the simulated values.
inversionMethod()
returns a list with the simulated values and the results
of the two-sample Kolmogorov-Smirnov test, as well as the plot of the CDFs of the
original and simulated data.
See Also
Examples
## 1. EXAMPLE
## Data
X <- rnorm(1000, mean = 5, sd = 3)
## Learning
f <- univMoTBF(X, POTENTIAL_TYPE="MOP", nparam=10)
plot(f, xlim = f$Domain)
## Random sample
Y <- rMoTBF(size = 500, fx = f)
ks.test(X,Y)
## Plots
hist(Y, prob = TRUE, add = TRUE)
## 2. EXAMPLE
## Data
X <- rweibull(5000, shape=2)
## Learning
f <- univMoTBF(X, POTENTIAL_TYPE="MOP", nparam=10)
plot(f, xlim = f$Domain)
## Random sample
inv <- inversionMethod(size = 500, fx = f, data = X)
attributes(inv)
inv$test
Y <- inv$sample
## Plots
plot(f, xlim = f$Domain)
hist(Y, prob = TRUE, add = TRUE)