Mean-Block Model with Unknown Clustering
Source:R/NormalBlockMeanUnknownClusters.R
NormalBlockMeanUnknownClusters.RdR6 class for a Normal-Block-Mean model with a fixed number of clusters (but unknown clustering), inferred by variational EM.
Super classes
NormalBlockBase -> NormalBlockMeanBase -> NormalBlockMeanUnknownClusters
Active bindings
fittedY values predicted by the model, in Y's original units
var_para list with the variational parameter: tau (posterior group probabilities)
nb_paramnumber of parameters in the model
entropyEntropy of the conditional distribution The only latent variable is the clustering, so the entropy of the variational distribution reduces to -sum(tau * log(tau)).
who_am_Ia method to print what model is being fitted
Methods
Inherited methods
NormalBlockBase$best_of_inits()NormalBlockBase$candidates_merge()NormalBlockBase$candidates_split()NormalBlockBase$latent_network()NormalBlockBase$optimize()NormalBlockBase$plot()NormalBlockBase$plot_loglik()NormalBlockBase$plot_network()NormalBlockBase$print()NormalBlockBase$update()NormalBlockMeanBase$merge()NormalBlockMeanBase$predict()NormalBlockMeanBase$split()NormalBlockMeanBase$warm_start_from()
NormalBlockMeanUnknownClusters$new()
Create a new [`NormalBlockMeanUnknownClusters`] object.
Usage
NormalBlockMeanUnknownClusters$new(
data,
q,
sparsity = 0,
control = NB_control()
)Examples
ex <- generate_normal_block_mean_data(n = 50, p = 20, d = 1, q = 3)
data <- NormalBlockData$new(ex$Y, ex$X)
model <- normal_block(data, blocks = 3, model = "mean")
#> Fitting a diagonal normal-block-mean model with 3 unknown blocks
#>
#> DONE
model$clustering
#> [1] 3 2 2 2 2 3 1 2 2 1 2 2 2 2 1 3 1 3 1 3