# NOT RUN {
## 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)
# }
Run the code above in your browser using DataCamp Workspace