data(annMax)
# basic usage on real data (annual discharge maxima in Austria)
dlf <- distLfit(annMax)
str(dlf, max.lev=2)
distLprint(dlf)
# arguments that can be passed:
distLfit(annMax, lty=2, col=3, legargs=list(lwd=3), main="booh!")
set.seed(42)
dlf_b <- distLfit(rbeta(100, 5, 2), nbest=10, legargs=c(x="left"))
distLplot(dlf_b, selection=c("gpa", "glo", "gev", "wak"))
distLplot(dlf_b, selection=c("gpa", "glo", "gev", "wak"), order=TRUE)
distLplot(dlf_b, coldist=c("orange",3:6), lty=1:3) # lty is recycled
distLplot(dlf_b, cdf=TRUE)
distLplot(dlf_b, cdf=TRUE, histargs=list(do.points=FALSE), sel="nor")
# Goodness of Fit is computed by RMSE, see first example of ?distLgof
# logarithmic axes:
set.seed(1)
y <- 10^rnorm(100, mean=2, sd=0.3) # if you use 1e4, distLgof will be much slower
hist(y, breaks=20)
berryFunctions::logHist(y, col=8)
dlf <- distLfit(log10(y), breaks=50)
distLplot(dlf, breaks=50, log=TRUE)
## Not run:
# # this takes a while, as it tries to fit all 30 distributions:
# d_all <- distLfit(annMax, gofProp=1, speed=FALSE, plot=FALSE) # 35 sec
# distLprint(d_all)
# distLplot(d_all, nbest=22, coldist=grey(1:22/29), xlim=c(20,140))
# distLplot(d_all, nbest=22, histargs=list(ylim=c(0,0.04)), xlim=c(20,140))
# d_all$gof
# ## End(Not run)
Run the code above in your browser using DataLab