Skip to contents

R6 class for a zero-inflated Normal-Block-Mean model with a known clustering. Sigma is diagonal or spherical here. See [NormalBlockMeanBase] for why a full one is out of reach under a mask.

Super classes

NormalBlockBase -> NormalBlockMeanBase -> ZINormalBlockMeanKnownClusters

Active bindings

fitted

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

model_par

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

nb_param

number of parameters in the model

who_am_I

a method to print what model is being fitted

Methods

Inherited methods


ZINormalBlockMeanKnownClusters$new()

Create a new [`ZINormalBlockMeanKnownClusters`] object.

Usage

ZINormalBlockMeanKnownClusters$new(
  data,
  C,
  sparsity = 0,
  control = NB_control()
)

Arguments

data

object of NormalBlockData class, with responses and design matrix

C

clustering matrix C_jk = 1 if species j belongs to cluster k

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 [`ZINormalBlockMeanKnownClusters`] object


ZINormalBlockMeanKnownClusters$clone()

The objects of this class are cloneable with this method.

Usage

ZINormalBlockMeanKnownClusters$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 = ex$parameters$C, model = "mean",
                      zero_inflation = TRUE)
#> Fitting a zero-inflated diagonal normal-block-mean model with fixed blocks 
#> 
#> DONE
model$clustering
#>  [1] 1 2 2 1 2 3 3 1 1 3 1 2 1 1 1 1 1 2 2 3