Professional Documents
Culture Documents
message(paste(
"fit_dist helper based on R package fitdistrplus",
"This script is distributed under the Creative Commons Attribution 4.0
International License.",
"For usage, examples and questions, see https://github.com/mhahsler/fit_dist",
sep = "\n")
)
x <- x[is.finite(x)]
if(is.null(distributions)) {
if(is.null(discrete)) discrete <- ifelse(all(x == floor(x)), TRUE, FALSE)
# fit distributions
f <- lapply(distributions, function(d) {
try(fitdist(x, d, ...), silent = FALSE)
})
# create plots
if(plot) {
oldpar <- par(mfrow = c(1, 2))
denscomp(f, legendtext = names(f))
qqcomp(f, legendtext = names(f))
#cdfcomp(f, legendtext = names(f))
#ppcomp(f, legendtext = names(f))
par(oldpar)
}
f
}