# NOT RUN {
# }
# NOT RUN {
## example data
set.seed(1234)
d <- data.frame(
Ynorm = rnorm(200),
Ybeta = rbeta(200, 1, 4),
Ychisq = rchisq(200, 8),
Yf = rf(200, 5, 10),
Ygamma = rgamma(200, 2, 2),
Ynbinom = rnbinom(200, mu = 4, size = 9),
Ypois = rpois(200, 4))
## testing and graphing
testdistr(d$Ybeta, "beta", starts = list(shape1 = 1, shape2 = 4))
testdistr(d$Ychisq, "chisq", starts = list(df = 8))
testdistr(d$Yf, "f", starts = list(df1 = 5, df2 = 10))
testdistr(d$Ygamma, "gamma")
testdistr(d$Ynbinom, "poisson")
testdistr(d$Ynbinom, "nbinom")
testdistr(d$Ypois, "poisson")
## compare log likelihood of two different distributions
testdistr(d$Ygamma, "normal")$Distribution$LL
testdistr(d$Ygamma, "gamma")$Distribution$LL
testdistr(d$Ynorm, "normal")
testdistr(c(d$Ynorm, 10, 1000), "normal",
extremevalues = "theoretical")
testdistr(c(d$Ynorm, 10, 1000), "normal",
extremevalues = "theoretical", robust = TRUE)
testdistr(mtcars, "mvnormal")
rm(d) ## cleanup
# }
Run the code above in your browser using DataLab