| PLNmixturefit | R Documentation |
The function PLNmixture produces a collection of models which are instances of object with class PLNmixturefit.
A PLNmixturefit (say, with k components) is itself a collection of k PLNfit.
This class comes with a set of methods, some of them being useful for the user: See the documentation for ...
nnumber of samples
pnumber of dimensions of the latent space
knumber of components
dnumber of covariates
componentscomponents of the mixture (PLNfits)
latenta matrix: values of the latent vector (Z in the model)
latent_posa matrix: values of the latent position vector (Z) without covariates effects or offset
posteriorProbmatrix ofposterior probability for cluster belonging
membershipsvector for cluster index
mixtureParamvector of cluster proportions
optim_para list with parameters useful for monitoring the optimization
nb_paramnumber of parameters in the current PLN model
entropy_clusteringEntropy of the variational distribution of the cluster (multinomial)
entropy_latentEntropy of the variational distribution of the latent vector (Gaussian)
entropyFull entropy of the variational distribution (latent vector + clustering)
loglikvariational lower bound of the loglikelihood
loglik_vecelement-wise variational lower bound of the loglikelihood
BICvariational lower bound of the BIC
ICLvariational lower bound of the ICL (include entropy of both the clustering and latent distributions)
R_squaredapproximated goodness-of-fit criterion
criteriaa vector with loglik, BIC, ICL, and number of parameters
model_para list with the matrices of parameters found in the model (Theta, Sigma, Mu and Pi)
vcov_modelcharacter: the model used for the covariance (either "spherical", "diagonal" or "full")
fitteda matrix: fitted values of the observations (A in the model)
group_meansa matrix of group mean vectors in the latent space.
new()Optimize a the
Initialize a PLNmixturefit model
PLNmixturefit$new( responses, covariates, offsets, posteriorProb, formula, control )
responsesthe matrix of responses common to every models
covariatesthe matrix of covariates common to every models
offsetsthe matrix of offsets common to every models
posteriorProbmatrix ofposterior probability for cluster belonging
formulamodel formula used for fitting, extracted from the formula in the upper-level call
controla list for controlling the optimization.
optimize()Optimize a PLNmixturefit model
PLNmixturefit$optimize(responses, covariates, offsets, config)
responsesthe matrix of responses common to every models
covariatesthe matrix of covariates common to every models
offsetsthe matrix of offsets common to every models
configa list for controlling the optimization
predict()Predict group of new samples
PLNmixturefit$predict(
newdata,
type = c("posterior", "response", "position"),
prior = matrix(rep(1/self$k, self$k), nrow(newdata), self$k, byrow = TRUE),
control = PLNmixture_param(),
envir = parent.frame()
)newdataA data frame in which to look for variables, offsets and counts with which to predict.
typeThe type of prediction required. The default posterior are posterior probabilities for each group ,
response is the group with maximal posterior probability and latent is the averaged latent coordinate (without
offset and nor covariate effects),
with weights equal to the posterior probabilities.
priorUser-specified prior group probabilities in the new data. The default uses a uniform prior.
controla list-like structure for controlling the fit. See PLNmixture_param() for details.
envirEnvironment in which the prediction is evaluated
plot_clustering_data()Plot the matrix of expected mean counts (without offsets, without covariate effects) reordered according the inferred clustering
PLNmixturefit$plot_clustering_data( main = "Expected counts reorder by clustering", plot = TRUE, log_scale = TRUE )
maincharacter. A title for the plot. An hopefully appropriate title will be used by default.
plotlogical. Should the plot be displayed or sent back as ggplot2::ggplot object
log_scalelogical. Should the color scale values be log-transform before plotting? Default is TRUE.
a ggplot2::ggplot graphic
plot_clustering_pca()Plot the individual map of a PCA performed on the latent coordinates, where individuals are colored according to the memberships
PLNmixturefit$plot_clustering_pca( main = "Clustering labels in Individual Factor Map", plot = TRUE )
maincharacter. A title for the plot. An hopefully appropriate title will be used by default.
plotlogical. Should the plot be displayed or sent back as ggplot2::ggplot object
a ggplot2::ggplot graphic
postTreatment()Update fields after optimization
PLNmixturefit$postTreatment( responses, covariates, offsets, weights, config_post, config_optim, nullModel )
responsesthe matrix of responses common to every models
covariatesthe matrix of covariates common to every models
offsetsthe matrix of offsets common to every models
weightsan optional vector of observation weights to be used in the fitting process.
config_posta list for controlling the post-treatment
config_optima list for controlling the optimization during the post-treatment computations
nullModelnull model used for approximate R2 computations. Defaults to a GLM model with same design matrix but not latent variable.
show()User friendly print method
PLNmixturefit$show()
print()User friendly print method
PLNmixturefit$print()
clone()The objects of this class are cloneable with this method.
PLNmixturefit$clone(deep = FALSE)
deepWhether to make a deep clone.
The function PLNmixture, the class PLNmixturefamily
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.