Learn R Programming

PLNmodels (version 0.9.5)

PLNPCAfamily: An R6 Class to represent a collection of PLNPCAfit

Description

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.

Arguments

Super class

PLNmodels::PLNfamily -> PLNPCAfamily

Public fields

responses

the matrix of responses common to every models

covariates

the matrix of covariates common to every models

offsets

the matrix of offsets common to every models

weights

the vector of observation weights

models

a list of PLNPCAfit object, one per rank.

inception

a PLNfit object, obtained when full rank is considered.

criteria

a data frame with the values of some criteria (variational lower bound J, BIC, ICL and R2) for the different models.

Active bindings

responses

the matrix of responses common to every models

covariates

the matrix of covariates common to every models

offsets

the matrix of offsets common to every models

weights

the vector of observation weights

ranks

the dimensions of the successively fitted models

models

a list of PLNPCAfit object, one per rank.

inception

a PLNfit object, obtained when full rank is considered.

criteria

a data frame with the values of some criteria (variational lower bound J, BIC, ICL and R2) for the different models.

Methods

Public methods

Method new()

Usage

PLNPCAfamily$new(
  ranks,
  responses,
  covariates,
  offsets,
  weights,
  model,
  control
)

Method optimize()

Usage

PLNPCAfamily$optimize(control)

Method getBestModel()

Usage

PLNPCAfamily$getBestModel(crit = c("BIC", "ICL", "R_squared"))

Method plot()

Usage

PLNPCAfamily$plot(criteria = c("loglik", "BIC", "ICL"), annotate = TRUE)

Method show()

Usage

PLNPCAfamily$show()

Method clone()

The objects of this class are cloneable with this method.

Usage

PLNPCAfamily$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

The function PLNPCA, the class PLNPCAfit

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)
class(myPCAs)
# }

Run the code above in your browser using DataLab