# Example 1 with built-in Weibull distribution
# \donttest{
set.seed(123)
x <- rweibull(100, shape = 2, scale = 1)
out <- gofic(x, params = list(shape = 2, scale = 1),
dfun = dweibull, pfun = pweibull, plot=FALSE)
out
# }
# Example 2: For a user defined distribution
# Goodness-of-Fit(GoF) and Model Diagnostics for Chen-Exponential distribution
#Data
x <- stress
#ML Estimates
params = list(alpha=2.5462, beta=0.0537, lambda=87.6028)
# Display plot and print numerical summary
gofic(x, params = params,
dfun = dchen.exp, pfun = pchen.exp, plot = TRUE, verbose = TRUE)
# Display plot only (no numerical summary)
gofic(x, params = params,
dfun = dchen.exp, pfun = pchen.exp, plot = TRUE, verbose = FALSE)
# Print numerical summary only (no plot)
gofic(x, params = params,
dfun = dchen.exp, pfun = pchen.exp, plot = FALSE, verbose = TRUE)
# Display plot; numerical summary stored in 'out'
out <- gofic(x, params = params,
dfun = dchen.exp, pfun = pchen.exp, plot = TRUE, verbose = FALSE)
print.gofic(out)
# Neither plot nor console output; results stored in 'out'
out <- gofic(x, params = params,
dfun = dchen.exp, pfun = pchen.exp, plot = FALSE, verbose = FALSE)
print.gofic(out)
Run the code above in your browser using DataLab