MoTBF-Distribution | R Documentation |
Random generation for mixtures of truncated basis functions defined in a specific domain. The inverse transform method is used.
rMoTBF(size, fx, domain = NULL) inversionMethod(size, fx, domain = NULL, data = NULL)
size |
A non-negative integer indicating the number of records to generate. |
fx |
An object of class |
domain |
A |
data |
A |
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.
integralMoTBF
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.