
Best model extraction from a collection of models
Source:R/PLNPCAfamily-S3methods.R, R/PLNfamily-S3methods.R, R/PLNmixturefamily-S3methods.R, and 1 more
getBestModel.RdBest model extraction from a collection of models
Usage
# S3 method for class 'PLNPCAfamily'
getBestModel(Robject, crit = c("ICL", "BIC"), ...)
getBestModel(Robject, crit, ...)
# S3 method for class 'PLNmixturefamily'
getBestModel(Robject, crit = c("ICL", "BIC"), ...)
# S3 method for class 'Networkfamily'
getBestModel(Robject, crit = c("BIC", "EBIC", "StARS"), ...)
# S3 method for class 'PLNnetworkfamily'
getBestModel(Robject, crit = c("BIC", "EBIC", "StARS"), ...)
# S3 method for class 'ZIPLNnetworkfamily'
getBestModel(Robject, crit = c("BIC", "EBIC", "StARS"), ...)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
ICLforPLNPCA, andBICforPLNnetwork. If StARS (Stability Approach to Regularization Selection) is chosen and stability selection was not yet performed, the function will call the methodstability_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 is0.9.
Value
Send back an object with class PLNPCAfit or PLNnetworkfit
Methods (by class)
getBestModel(PLNPCAfamily): Model extraction forPLNPCAfamilygetBestModel(PLNmixturefamily): Model extraction forPLNmixturefamilygetBestModel(Networkfamily): Model extraction forPLNnetworkfamilyorZIPLNnetworkfamilygetBestModel(PLNnetworkfamily): Model extraction forPLNnetworkfamilygetBestModel(ZIPLNnetworkfamily): Model extraction forZIPLNnetworkfamily
Examples
if (FALSE) { # \dontrun{
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPCA <- PLNPCA(Abundance ~ 1 + offset(log(Offset)), data = trichoptera, ranks = 1:4)
myModel <- getBestModel(myPCA)
} # }