Learn R Programming

PLNmodels (version 0.9.5)

PLNLDAfit: An R6 Class to represent a PLNfit in a LDA framework

Description

The function PLNLDA produces an instance of an object with class PLNPLDAfit.

This class comes with a set of methods, some of them being useful for the user: See the documentation for the methods inherited by PLNfit, the plot.PLNPCAfit method for LDA vizualization and predict.PLNPCAfit method for prediction

Arguments

Super class

PLNmodels::PLNfit -> PLNLDAfit

Public fields

var_par

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

optim_par

a list with parameters useful for monitoring the optimization

loglik

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

criteria

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

Active bindings

rank

the dimension of the current model

model_par

a list with the matrices associated with the estimated parameters of the PLN model: Theta (covariates), Sigma (latent covariance), B (latent loadings), P (latent position) and Mu (group means)

var_par

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

optim_par

a list with parameters useful for monitoring the optimization

loglik

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

criteria

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

nb_param

number of parameters in the current PLN model

percent_var

the percent of variance explained by each axis

corr_map

a matrix of correlations to plot the correlation circles

scores

a matrix of scores to plot the individual factor maps

Methods

Public methods

Method new()

Usage

PLNLDAfit$new(
  grouping,
  responses,
  covariates,
  offsets,
  weights,
  model,
  control
)

Method optimize()

Usage

PLNLDAfit$optimize(X, covar, design_group, control)

Method setVisualization()

Usage

PLNLDAfit$setVisualization(scale.unit = FALSE)

Method postTreatment()

Usage

PLNLDAfit$postTreatment(responses, covariates, offsets)

Method plot_individual_map()

Usage

PLNLDAfit$plot_individual_map(
  axes = 1:min(2, self$rank),
  main = "Individual Factor Map",
  plot = TRUE
)

Method plot_correlation_map()

Usage

PLNLDAfit$plot_correlation_map(
  axes = 1:min(2, self$rank),
  main = "Variable Factor Map",
  cols = "default",
  plot = TRUE
)

Method plot_LDA()

Usage

PLNLDAfit$plot_LDA(
  nb_axes = min(3, self$rank),
  var_cols = "default",
  plot = TRUE
)

Method predict()

Usage

PLNLDAfit$predict(
  newdata,
  type = c("posterior", "response", "scores"),
  scale = c("log", "prob"),
  prior = NULL,
  control = list(),
  envir = parent.frame()
)

Method show()

Usage

PLNLDAfit$show()

Method clone()

The objects of this class are cloneable with this method.

Usage

PLNLDAfit$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

The function PLNLDA.

Examples

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

Run the code above in your browser using DataLab