Learn R Programming

PLNmodels (version 0.11.7)

getBestModel.PLNPCAfamily: Best model extraction from a collection of models

Description

Best model extraction from a collection of models

Usage

# S3 method for PLNPCAfamily
getBestModel(Robject, crit = c("ICL", "BIC"), ...)

getBestModel(Robject, crit, ...)

# S3 method for PLNmixturefamily getBestModel(Robject, crit = c("ICL", "BIC"), ...)

# S3 method for PLNnetworkfamily getBestModel(Robject, crit = c("BIC", "EBIC", "StARS"), ...)

Value

Send back an object with class PLNPCAfit or PLNnetworkfit

Arguments

Robject

an object with class PLNPCAfamilly ot PLNnetworkfamily

crit

a character for the criterion used to performed the selection. Either "BIC", "ICL", "EBIC", "StARS", "R_squared". Default is ICL for PLNPCA, and BIC for PLNnetwork. If StARS (Stability Approach to Regularization Selection) is chosen and stability selection was not yet performed, the function will call the method stability_selection() with default argument.

...

additional parameters for StARS criterion (only for PLNnetwork). stability, a scalar indicating the target stability (= 1 - 2 beta) at which the network is selected. Default is 0.9.

Methods (by class)

  • getBestModel(PLNPCAfamily): Model extraction for PLNPCAfamily

  • getBestModel(PLNmixturefamily): Model extraction for PLNmixturefamily

  • getBestModel(PLNnetworkfamily): Model extraction for PLNnetworkfamily

Examples

Run this code
if (FALSE) {
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPCA <- PLNPCA(Abundance ~ 1 + offset(log(Offset)), data = trichoptera, ranks = 1:4)
myModel <- getBestModel(myPCA)
}

Run the code above in your browser using DataLab