
An R6 Class to represent a PLNfit in a standard, general framework, with diagonal residual covariance
Source:R/PLNfit-class.R, R/PLNLDAfit-class.R
PLNfit_diagonal.RdThe 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
Super class
PLNfit -> PLNfit_diagonal
Active bindings
nb_paramnumber of parameters in the current PLN model
vcov_modelcharacter: the model used for the residual covariance
Methods
PLNfit_diagonal$new()
Initialize a PLNfit model
Usage
PLNfit_diagonal$new(responses, covariates, offsets, weights, formula, control)Arguments
responsesthe matrix of responses (called Y in the model). Will usually be extracted from the corresponding field in PLNfamily-class
covariatesdesign matrix (called X in the model). Will usually be extracted from the corresponding field in PLNfamily-class
offsetsoffset matrix (called O in the model). Will usually be extracted from the corresponding field in PLNfamily-class
weightsan optional vector of observation weights to be used in the fitting process.
formulamodel formula used for fitting, extracted from the formula in the upper-level call
controla list for controlling the optimization. See details.
Active bindings
vcov_modelcharacter: the model used for the residual covariance
nb_paramnumber of parameters in the current PLN model
Methods
PLNLDAfit_spherical$new()
Initialize a PLNfit model
Usage
PLNLDAfit_spherical$new(
grouping,
responses,
covariates,
offsets,
weights,
formula,
control
)Arguments
groupinga factor specifying the class of each observation used for discriminant analysis.
responsesthe matrix of responses (called Y in the model). Will usually be extracted from the corresponding field in PLNfamily-class
covariatesdesign matrix (called X in the model). Will usually be extracted from the corresponding field in PLNfamily-class
offsetsoffset matrix (called O in the model). Will usually be extracted from the corresponding field in PLNfamily-class
weightsan optional vector of observation weights to be used in the fitting process.
formulamodel formula used for fitting, extracted from the formula in the upper-level call
controla list for controlling the optimization. See details.
Examples
if (FALSE) { # \dontrun{
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLN <- PLN(Abundance ~ 1, data = trichoptera)
class(myPLN)
print(myPLN)
} # }
if (FALSE) { # \dontrun{
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLNLDA <- PLNLDA(Abundance ~ 1, data = trichoptera, control = PLN_param(covariance = "spherical"))
class(myPLNLDA)
print(myPLNLDA)
} # }