# NOT RUN {
if (requireNamespace("GoFKernel", quietly = TRUE) &&
requireNamespace("pracma", quietly = TRUE)) {
pdf <- function(x) ifelse(x < 1 | x > 10, 0, 1 / 10)
x <- Distribution$new("Test",
pdf = pdf,
support = set6::Interval$new(1, 10, class = "integer"),
type = set6::Naturals$new()
)
decorate(x, "FunctionImputation", n = 1000)
x <- Distribution$new("Test",
pdf = pdf,
support = set6::Interval$new(1, 10, class = "integer"),
type = set6::Naturals$new(),
decorators = "FunctionImputation"
)
x <- Distribution$new("Test",
pdf = pdf,
support = set6::Interval$new(1, 10, class = "integer"),
type = set6::Naturals$new()
)
FunctionImputation$new()$decorate(x, n = 1000)
x$pdf(1:10)
x$cdf(1:10)
x$quantile(0.42)
x$rand(4)
}
# }
Run the code above in your browser using DataLab