The function PLNLDA() produces an instance of an object with class PLNLDAfit.

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() method for LDA visualization and predict() method for prediction

The function PLNLDA.

Super class

PLNmodels::PLNfit -> PLNLDAfit

Active bindings

rank

the dimension of the current model

nb_param

number of parameters in the current PLN model

model_par

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

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

group_means

a matrix of group mean vectors in the latent space.

Methods

Inherited methods

Method new()

Initialize a PLNLDAfit object

Arguments

grouping

a factor specifying the class of each observation used for discriminant analysis.

responses

the matrix of responses (called Y in the model). Will usually be extracted from the corresponding field in PLNfamily-class

covariates

design matrix. Automatically built from the covariates and the formula from the call

offsets

offset matrix (called O in the model). Will usually be extracted from the corresponding field in PLNfamily-class

weights

an optional vector of observation weights to be used in the fitting process.

config

list controlling the optimization

X

Abundance matrix.

Method postTreatment()

Update R2, fisher and std_err fields and visualization

Arguments

scale.unit

Logical. Should LDA scores be rescaled to have unit variance

Method plot_individual_map()

Plot the factorial map of the LDA

Usage

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

Arguments

axes

numeric, the axes to use for the plot when map = "individual" or "variable". Default it c(1,min(rank))

main

character. A title for the single plot (individual or variable factor map). If NULL (the default), an hopefully appropriate title will be used.

plot

logical. Should the plot be displayed or sent back as ggplot object

Returns

a ggplot graphic

Method plot_correlation_map()

Plot the correlation circle of a specified axis for a PLNLDAfit object

Usage

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

Arguments

axes

numeric, the axes to use for the plot when map = "individual" or "variable". Default it c(1,min(rank))

main

character. A title for the single plot (individual or variable factor map). If NULL (the default), an hopefully appropriate title will be used.

cols

a character, factor or numeric to define the color associated with the variables. By default, all variables receive the default color of the current palette.

plot

logical. Should the plot be displayed or sent back as ggplot object

Returns

a ggplot graphic

Method plot_LDA()

Plot a summary of the PLNLDAfit object

Usage

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

Arguments

nb_axes

scalar: the number of axes to be considered when map = "both". The default is min(3,rank).

var_cols

a character, factor or numeric to define the color associated with the variables. By default, all variables receive the default color of the current palette.

plot

logical. Should the plot be displayed or sent back as ggplot object

Returns

a grob object

Method predict()

Predict group of new samples

Method clone()

The objects of this class are cloneable with this method.

PLNLDAfit$clone(deep = FALSE) Arguments deep Whether to make a deep clone. Examples if (FALSE) { data(trichoptera) trichoptera <- prepare_data(trichoptera$Abundance, trichoptera\$Covariate)
myPLNLDA <- PLNLDA(Abundance ~ 1, grouping = Group, data = trichoptera)
class(myPLNLDA)
print(myPLNLDA)
}