| PLNPCAfamily {PLNmodels} | R Documentation |
The function PLNPCA() produces an instance of this class.
This class comes with a set of methods, some of them being useful for the user:
See the documentation for getBestModel(),
getModel() and plot().
PLNmodels::PLNfamily -> PLNPCAfamily
ranksthe dimensions of the successively fitted models
new()Initialize all models in the collection.
PLNPCAfamily$new( ranks, responses, covariates, offsets, weights, model, xlevels, control )
ranksthe dimensions of the successively fitted models
responsesthe matrix of responses common to every models
covariatesthe matrix of covariates common to every models
offsetsthe matrix of offsets common to every models
weightsthe vector of observation weights
modelmodel used for fitting, extracted from the formula in the upper-level call
xlevelsnamed listed of factor levels included in the models, extracted from the formula in the upper-level call and used for predictions.
controla list for controlling the optimization. See details.
optimize()Call to the C++ optimizer on all models of the collection
PLNPCAfamily$optimize(control)
controla list for controlling the optimization. See details.
getBestModel()Extract best model in the collection
PLNPCAfamily$getBestModel(crit = c("BIC", "ICL", "R_squared"))crita character for the criterion used to performed the selection. Either
"BIC", "ICL", or "R_squared". Default is BIC
a PLNPCAfit object
plot()Lineplot of selected criteria for all models in the collection
PLNPCAfamily$plot(criteria = c("loglik", "BIC", "ICL"), annotate = TRUE)criteriaA valid model selection criteria for the collection of models. Any of "loglik", "BIC" or "ICL" (all).
annotateLogical. Should R2 be added to the plot (defaults to TRUE)
A ggplot2 object
show()User friendly print method
PLNPCAfamily$show()
clone()The objects of this class are cloneable with this method.
PLNPCAfamily$clone(deep = FALSE)
deepWhether to make a deep clone.
The function PLNPCA(), the class PLNPCAfit()
data(trichoptera) trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate) myPCAs <- PLNPCA(Abundance ~ 1 + offset(log(Offset)), data = trichoptera, ranks = 1:5) class(myPCAs)