Learn R Programming

PLNmodels (version 0.9.5)

plot.PLNPCAfamily: Display the criteria associated with a collection of PLNPCA fits (a PLNPCAfamily)

Description

Display the criteria associated with a collection of PLNPCA fits (a PLNPCAfamily)

Usage

# S3 method for PLNPCAfamily
plot(x, criteria = c("loglik", "BIC", "ICL"), annotate = TRUE, ...)

Arguments

x

an R6 object with class PLNfamily

criteria

vector of characters. The criteria to plot in c("loglik", "BIC", "ICL", "R_squared"). Default is c("loglik", "BIC", "ICL").

annotate

logical: should the value of approximated R squared be added to the plot?

...

additional parameters for S3 compatibility. Not used

Value

Produces a plot representing the evolution of the criteria of the different models considered, highlighting the best model in terms of BIC and ICL (the greater, the better). These criteria have the form 'loglik - 1/2 * penalty' so that they are on the same scale as the model loglikelihood.

Examples

Run this code
# NOT RUN {
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPCAs <- PLNPCA(Abundance ~ 1 + offset(log(Offset)), data = trichoptera, ranks = 1:5)
# }
# NOT RUN {
plot(myPCAs)
# }

Run the code above in your browser using DataLab