Learn R Programming

PLNmodels (version 0.9.5)

PLNfit: An R6 Class to represent a PLNfit in a standard, general framework

Description

The function PLN fit a model which is an instance of a object with class PLNfit . Objects produced by the functions PLNnetwork, PLNPCA and PLNLDA also enjoy the method of PLNfit by inheritance.

This class comes with a set of R6 methods, some of them being useful for the user and exported as S3 methods. See the documentation for coef, sigma.PLNfit, predict, vcov and standard_error.

Fields are accessed via active binding and cannot be changed by the user.

Arguments

Public fields

model

character: the model used for the coavariance (either "spherical", "diagonal" or "full")

Active bindings

model_par

a list with the matrices of parameters found in the model (Theta, Sigma, plus some others depending on the variant)

var_par

a list with two matrices, M and S, which are the estimated parameters in the variational approximation

latent

a matrix: values of the latent vector (Z in the model)

optim_par

a list with parameters useful for monitoring the optimization

model

character: the model used for the coavariance (either "spherical", "diagonal" or "full")

loglik

variational lower bound of the loglikelihood

loglik_vec

element-wise variational lower bound of the loglikelihood

BIC

variational lower bound of the BIC

ICL

variational lower bound of the ICL

R_squared

approximated goodness-of-fit criterion

nb_param

number of parameters in the current PLN model

criteria

a vector with loglik, BIC, ICL, R_squared and number of parameters

Methods

Public methods

Method update()

Usage

PLNfit$update(
  Theta = NA,
  Sigma = NA,
  M = NA,
  S = NA,
  Ji = NA,
  R2 = NA,
  Z = NA,
  A = NA,
  monitoring = NA
)

Method new()

Usage

PLNfit$new(responses, covariates, offsets, weights, model, control)

Method optimize()

Usage

PLNfit$optimize(responses, covariates, offsets, weights, control)

Method set_R2()

Usage

PLNfit$set_R2(responses, covariates, offsets, weights, nullModel = NULL)

Method postTreatment()

Usage

PLNfit$postTreatment(
  responses,
  covariates,
  offsets,
  weights = rep(1, nrow(responses)),
  type = c("wald", "louis"),
  nullModel = NULL
)

Method latent_pos()

Usage

PLNfit$latent_pos(covariates, offsets)

Method VEstep()

Usage

PLNfit$VEstep(X, O, Y, control = list())

Method predict()

Usage

PLNfit$predict(newdata, type = c("link", "response"), envir = parent.frame())

Method compute_fisher()

Usage

PLNfit$compute_fisher(type = c("wald", "louis"), X = NULL)

Method compute_standard_error()

Usage

PLNfit$compute_standard_error()

Method show()

Usage

PLNfit$show(
  model = paste("A multivariate Poisson Lognormal fit with", private$covariance,
    "covariance model.\n")
)

Method print()

Usage

PLNfit$print()

Method clone()

The objects of this class are cloneable with this method.

Usage

PLNfit$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
# NOT RUN {
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLN <- PLN(Abundance ~ 1, data = trichoptera)
class(myPLN)
print(myPLN)
# }

Run the code above in your browser using DataLab