plot.gkwfit | R Documentation |
Creates a panel of diagnostic plots for assessing the fit of a model estimated
by gkwfit
. It displays a histogram of the data overlaid with the
fitted density, a Probability-Probability (P-P) plot, a Quantile-Quantile (Q-Q)
plot, and profile likelihood plots for each parameter if they were computed
during the fit (i.e., if profile = TRUE
was used in gkwfit
).
## S3 method for class 'gkwfit'
plot(x, ...)
x |
An object of class |
... |
Additional arguments (currently ignored). |
This function utilizes ggplot2
for creating the plots and patchwork
for arranging them into a single figure. All plots use ggplot2::theme_minimal()
.
If the plots were already generated during the original gkwfit
call
(because plot = TRUE
), they are retrieved from the fitted object.
Otherwise, this function will attempt to generate the plots on the fly,
which requires the ggplot2
package and the necessary distribution
functions (like dgkw
, pgkw
, qgkw
, etc.) for the specific
family
to be available.
The arrangement of plots is handled automatically by patchwork::wrap_plots
.
No user interaction (like menu selection) is required.
Invisibly returns the original input object x
. This function is called for its side effect of producing a plot.
Lopes, J. E.
gkwfit
, summary.gkwfit
# Load required package
library(ggplot2)
# Generate data and fit model
set.seed(2203)
y <- rbeta_(50, gamma = 2, delta = 3)
fit <- gkwfit(data = y, family = "beta", plot = FALSE)
# Generate standard diagnostic plots
plot(fit)
# Generate data and fit model with profile = TRUE
fit <- gkwfit(data = y, family = "gkw", profile = TRUE, npoints = 15)
# Standard diagnostic plots
plot(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.