screeplot.sgdgmf: Screeplot for the residuals of a GMF model

screeplot.sgdgmfR Documentation

Screeplot for the residuals of a GMF model

Description

Plots the variances of the principal components of the residuals against the number of principal component.

Usage

## S3 method for class 'sgdgmf'
screeplot(
  x,
  ...,
  ncomp = 20,
  type = c("deviance", "pearson", "working", "response", "link"),
  partial = FALSE,
  normalize = FALSE,
  cumulative = FALSE,
  proportion = FALSE
)

Arguments

x

an object of class sgdgmf

...

further arguments passed to or from other methods

ncomp

number of components to be plotted

type

the type of residuals which should be used

partial

if TRUE, plots the eigenvalues of the partial residuals

normalize

if TRUE, plots the eigenvalues of the standardized residuals

cumulative

if TRUE, plots the cumulative sum of the eigenvalues

proportion

if TRUE, plots the fractions of explained variance

Value

A ggplot object showing the residual screeplot of the model.

Examples

# 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 partial residual spectrum of a GMF model
screeplot(gmf) # screeplot of the var-cov matrix of the deviance residuals
screeplot(gmf, partial = TRUE) # screeplot of the partial residuals
screeplot(gmf, cumulative = TRUE) # cumulative screeplot
screeplot(gmf, proportion = TRUE) # proportion of explained residual variance


sgdGMF documentation built on April 3, 2025, 7:37 p.m.