plot.initgmf | R Documentation |
Plots (one of) six diagnostics to graphically analyze the marginal and conditional distribution of the residuals of a GMF model. Currently, the following plots are available: residuals against observation indices, residuals agains fitted values, absolute square-root residuals against fitted values, histogram of the residuals, residual QQ-plot, residual ECDF-plot.
## S3 method for class 'initgmf'
plot(
x,
...,
type = c("res-idx", "res-fit", "std-fit", "hist", "qq", "ecdf"),
resid = c("deviance", "pearson", "working", "response", "link"),
subsample = FALSE,
sample.size = 500,
partial = FALSE,
normalize = FALSE,
fillna = FALSE
)
x |
an object of class |
... |
further arguments passed to or from other methods |
type |
the type of plot which should be returned |
resid |
the type of residuals which should be used |
subsample |
if |
sample.size |
the dimension of the sub-sample which should be used |
partial |
if |
normalize |
if |
fillna |
if |
A ggplot object showing the selected diagnostic plot.
plot.sgdgmf
.
# Load the sgdGMF package
library(sgdGMF)
# Generate data from a Poisson model
data = sim.gmf.data(n = 100, m = 20, ncomp = 5, family = poisson())
# Fit a GMF model
init = sgdgmf.init(data$Y, ncomp = 3, family = poisson())
# Plot the residual-based GMF diagnostics
plot(init, type = "res-fit") # Residuals vs fitted values
plot(init, type = "std-fit") # Abs-sqrt-transformed residuals vs fitted values
plot(init, type = "qq") # Residual QQ-plot
plot(init, type = "hist") # Residual histogram
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.