Skip to contents

R6 class for a zero-inflated Normal-Block-Mean model with a fixed number of clusters (but unknown clustering), inferred by variational EM. Sigma is diagonal or spherical here. See [NormalBlockMeanBase] for why a full one is out of reach under a mask.

Super classes

NormalBlockBase -> NormalBlockMeanBase -> ZINormalBlockMeanUnknownClusters

Active bindings

fitted

Y values predicted by the model, in Y's original units

var_par

a list with the variational parameter: tau (posterior group probabilities)

model_par

a list with model parameters: B, Omega and kappa (zero-inflation probabilities)

nb_param

number of parameters in the model

entropy

Entropy of the conditional distribution

who_am_I

a method to print what model is being fitted

Methods

Inherited methods


ZINormalBlockMeanUnknownClusters$new()

Create a new [`ZINormalBlockMeanUnknownClusters`] object.

Usage

ZINormalBlockMeanUnknownClusters$new(
  data,
  q,
  sparsity = 0,
  control = NB_control()
)

Arguments

data

object of NormalBlockData class, with responses and design matrix

q

number of clusters

sparsity

unused here, kept for signature symmetry (must be 0)

control

structured list of more specific parameters, to generate with NB_control

Returns

A new [`ZINormalBlockMeanUnknownClusters`] object


ZINormalBlockMeanUnknownClusters$clone()

The objects of this class are cloneable with this method.

Usage

ZINormalBlockMeanUnknownClusters$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

ex <- generate_normal_block_mean_data(n = 50, p = 20, d = 1, q = 3)
Y <- ex$Y; Y[runif(length(Y)) < 0.2] <- 0
data <- NormalBlockData$new(Y, ex$X)
model <- normal_block(data, blocks = 3, model = "mean", zero_inflation = TRUE)
#> Fitting a zero-inflated diagonal normal-block-mean model with unknown blocks 
#> 
#> DONE
model$clustering
#>  [1] 1 2 2 1 3 1 1 2 3 2 2 1 3 2 1 2 3 2 1 1