image.sgdgmf | R Documentation |
Plots a heatmap of either the data, the fitted values, or the residual values of a GMF model allowing for different types of transformations and normalizations. Moreover, it also permits to plot the latent score and loading matrices.
## S3 method for class 'sgdgmf'
image(
x,
...,
type = c("data", "response", "link", "scores", "loadings", "deviance", "pearson",
"working"),
resid = FALSE,
symmetric = FALSE,
transpose = FALSE,
limits = NULL,
palette = NULL
)
x |
an object of class |
... |
further arguments passed to or from other methods |
type |
the type of data/predictions/residuals which should be returned |
resid |
if |
symmetric |
if |
transpose |
if |
limits |
the color limits which should be used |
palette |
the color-palette which should be used |
A ggplot object showing the selected heatmap.
# 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
gmf = sgdgmf.fit(data$Y, ncomp = 3, family = poisson())
# Get the heatmap of a GMF model
image(gmf, type = "data") # original data
image(gmf, type = "response") # fitted values in response scale
image(gmf, type = "scores") # estimated score matrix
image(gmf, type = "loadings") # estimated loading matrix
image(gmf, type = "deviance", resid = TRUE) # deviance residual matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.