R6 abstract class for the sparse Normal-Block models, where the clustering structures the latent covariance.
Super class
NormalBlockBase -> NormalBlockVarBase
Active bindings
B_originalregression coefficients (d x p), converted back to Y's original units (undoing
NormalBlockData(scale = TRUE)'s column-wise rescaling, if any). Usemodel_par$Binstead for the coefficients on the internal fitting scale.fittedY values predicted by the model, in Y's original units:
X B, plus the posterior mean of the latent block signals for (V)EM fits, with the observed zeros of zero-inflated models set to 0model_para list with the model parameters: B (d x p regression coefficients), B0 (zero-inflation coefficients, if any), dm1 (inverse noise variances of the variables) and Omega (q x q precision matrix of the latent block signals), on the scale of the fit. Use
$B_original/$dm1_originalfor B and dm1 on Y's original scale.sparsity_weights(weights associated to each pair of groups)
dm1_originalinverse residual variance per variable (1 / Var(Y_j)), converted back to Y's original units. Use
model_par$dm1instead for the internal fitting scale. Withnoise_covariance = "spherical",model_par$dm1is a single value repeated p times; once converted back per-variable, the p values returned here generally differ from one another whenever Y's columns were rescaled by different factors.
Methods
Inherited methods
NormalBlockBase$best_of_inits()NormalBlockBase$candidates_merge()NormalBlockBase$candidates_split()NormalBlockBase$heldout_loglik()NormalBlockBase$latent_network()NormalBlockBase$optimize()NormalBlockBase$plot()NormalBlockBase$plot_loglik()NormalBlockBase$plot_network()NormalBlockBase$predict()NormalBlockBase$print()NormalBlockBase$update()NormalBlockBase$warm_start_from()
NormalBlockVarBase$new()
Create a new NormalBlockVarBase object.
Usage
NormalBlockVarBase$new(
data,
q,
sparsity = 0,
control = NB_control(),
zero_inflation = FALSE
)Arguments
dataobject of NormalBlockData class, with responses and design matrix
qnumber of block/cluster
sparsitysparsity penalty on the network density
controlstructured list of more specific parameters, to generate with NB_control
zero_inflationwhether the concrete subclass models zero-inflation; set by the ZI subclasses themselves, not meant to be set by the end user. When
FALSE, the (costly) zero-inflation probability fit (kappa/B0) is skipped entirely, since it would otherwise never be used downstream.
NormalBlockVarBase$within_block_correlations()
Checks that the blocks gather positively co-varying
variables, as the model requires (two variables of a block have a
positive correlation). Compares, for each block, the empirical
correlations of the residuals Y - XB with those implied by the model.
NormalBlockVarBase$split()
Create a clone of the current NormalBlockVarBase object after splitting cluster index
Arguments
indexindex (integer) of the cluster to split
in_placeshould the split applied to the object itself, or should a copy be sent? default FALSE (send a copy)
rulehow the members of the cluster are divided:
"kmeans"runs a 2-means on their columns of residualsY - XB;"noise"cuts them at the median of their noise variance. DefaultNULL, i.e."kmeans"for this family.
NormalBlockVarBase$merge()
Create a clone of the current NormalBlockVarBase object after merging clusters cl1 and cl2