Users of 0.3.0 will see different results on the same calls:
log(n) for all: the
cluster proportions log(p), the mean-block cluster profiles and a
spherical noise variance log(n * p), the rest log(n). The ICL completes
the partition only (Biernacki, Celeux & Govaert, 2000), ICL = BIC + 2 *
entropy with entropy = -sum(tau * log(tau)), so that it equals the BIC
for a known clustering in both families. The EBIC of mean-block models
counts its edges among the p variables (it used q). The selected number of
clusters can change.NormalBlockData$new()
gains scale = NULL as its default: variance-block models keep rescaling
each column of Y by its standard deviation, mean-block models no longer
do (rescaling breaks the mean profile shared within a block). TRUE or
FALSE forces either for both families.refine(). The
default clustering_init is "kmeans" for both families (it was
"ward2" for variance-block models), and collections over a range of q
are polished by the split and merge search of refine() after their
cold-started fit (NB_control(refine = TRUE); FALSE restores the former
behavior). "ward2" remains a good choice for zero-inflated abundances.NB_control(acceleration = NULL), the new
default, keeps SQUAREM for variance-block models and full-Sigma mean-block
models; TRUE or FALSE forces it.coef() of
variance-block models returns B on the original scale of Y (it returned it
on the rescaled scale of the fit, unlike fitted() and predict()), and
so does sigma() for the p x p covariance of mean-block models. Quantities
defined per cluster (variance-block sigma(), mean-block coef()) stay on
the scale of the fit. coef(), sigma(), fitted(), predict() and
latent_network() keep the names of the variables and covariates, and
name the clusters Cluster_1, ... (also in the network plots and the
StARS stability path).heldout_loglik(newdata)
on every fitted model gives the exact log-likelihood of new observations at
the fitted parameters and the MAP partition, on Y's original scale (for
variance-block models, the marginal over the latent W, with q x q matrices
only). normal_block_cv() computes the K-fold cross-validated
log-likelihood of a collection over q, a penalty-free criterion that
compares families, shapes of Sigma and scalings on the same footing, and
selects q by the one-standard-error rule; it has print() and plot()
methods.get_best_model("StARS") and
stability_selection() apply to both families, the clustering being held
fixed on the subsamples.normal_block_sequential() accepts, as blocks_mean, a mean-block model or
collection already fitted on the same data, which is then not refitted.within_block_correlations() compares, for each block of a
variance-block model, the empirical correlations of the residuals with the
positive correlation the model implies: a block holding anticorrelated
variables, typically from a known clustering taken from an annotation, is
misspecified. Collections over q gain a deviance_violations field (values
of q whose deviance exceeds the previous one, a sign of a poor local
optimum), reported by print().refine(). split() gains a rule argument and
refine() / candidates_split() a split_rule one: "kmeans" (a 2-means
on the members' residuals or least-squares trajectories, the default for
the variance-block family) or "noise" (a cut at the median of the noise
variances, the default for the mean-block family). Variance-block merge
candidates are ranked by the signed correlation between the latent block
signals, since a block can only gather positively co-varying variables.plot() method for collections of models: the criteria against q or the
penalty, or a heatmap over both (it wraps the collections' $plot()). The
model selected by each criterion is marked on its curve and labelled with
the criterion and the selected q or penalty, so that it is clear which
dashed line belongs to which criterion.penalty_terms and penalty (the BIC penalty, group by
group), NormalBlockData$for_family() (the data a family is fitted on),
NormalBlockData$subset() and $Y_original, and sparsity_details on
mean-block sparsity paths.src/graphical_lasso.h) is shared verbatim with
PLNmodels. It solves the problem scaled to a unit diagonal, which makes it
converge on covariances whose variances span orders of magnitude, shifts an
indefinite precision matrix on its diagonal (keeping its support), detects
limit cycles and can be interrupted. graphical_lasso_fit() also returns
status, delta and shift.X0 and the scale request.plot_network() computes the layout without the signed edge weights, so
that force-directed layouts such as igraph::layout_with_fr work; layout
may also be a matrix of coordinates. Mean-block networks are labeled with
the variable names.model_par exposes the cluster proportions alpha of mean-block models
with an unknown clustering, and B0 of zero-inflated mean-block models, as
in the variance-block family.NB_control(clustering_init = "best_of_inits") with a known clustering
crashed: the known clustering is now simply fitted.sparsity_weights
left some pairs unpenalized; such pairs are now ignored by the default
penalty grid.refine()
then failed: NormalBlockData$new() now refuses such columns, naming them
(normal_block_cv() names the fold where it happens). A split or merge
candidate whose fit fails is discarded by refine() instead of aborting
it.generate_normal_block_var_data() and generate_normal_block_mean_data()
honor alpha, and could put a variable in two clusters when the first
draw left a cluster empty. Data simulated for a given seed are unchanged
otherwise.zeros mask and the formula.summary() of a model and print() of a sequential fit wrap their long
lines at the console width; the descriptions of the collections are the
same for both families.print() of a collection no longer suggests refine() for a deviance
increase that refine() has already failed to repair.model.matrix(~ 0 + factor(labels)).NB_control(threshold = ) negative runs exactly niter iterations,
without the warning about the iteration cap.fixed_tau is read from the control list by both families (the public
$fixed_tau field of variance-block models is removed); update() loses
the arguments Psi, Phi, Lambda and kappa, which it stored but never
used.The package now fits two complementary families. The original Normal-Block
model clusters variables by how they covary; the new mean-block family
clusters them by how they respond to the covariates, constraining the mean
as mu_i = C B' X_i with one regression profile per cluster.
normal_block(..., model = "mean") fits it, for a known clustering
(NormalBlockMeanKnownClusters) or an unknown one inferred by variational
EM (NormalBlockMeanUnknownClusters), over a range of cluster counts
(NormalBlockMeanCollectionClusters), a penalty path
(NormalBlockMeanCollectionSparsity) or both
(NormalBlockMeanCollectionClustersSparsity).ZINormalBlockMeanKnownClusters,
ZINormalBlockMeanUnknownClusters), and collections of those over a range
of cluster counts.noise_covariance gains a "full" shape for this family, whose Sigma is
the p x p residual covariance rather than a diagonal noise term.
"diagonal" is the default: a full Sigma spends p(p+1)/2 parameters that
drown the mean structure the criteria are weighing, and selects the number
of clusters markedly worse as p approaches n. Asking for sparsity > 0
implies "full", since a diagonal precision matrix has nothing for the
graphical lasso to penalize.normal_block_sequential() chains the two families: a mean-block fit, then
a variance-block fit on its residuals. A heuristic two-stage estimator, not
a joint model.NormalBlockData$new() gains a zeros argument, to carry an explicit
zero-inflation mask when the matrix handed to a model is no longer the one
carrying the zeros (the residuals of a first stage, say).This also fixes the segfault CRAN reported on
r-devel-linux-x86_64-fedora-gcc when re-building
breast-cancer-proteomics.Rmd (address 0x580, cause 'memory not mapped'),
which our own CI had been hitting intermittently on Linux.
glassoFast is no longer a dependency. The C++ (V)EM used to call back into
R once per M-step to reach it -- thousands of round trips from inside a
single .Call for one sparsity path, and a recurring source of intermittent
crashes. The solver now lives in src/graphical_lasso.h.glassoFast are fixed on the way. When the empirical covariance
has no off-diagonal mass the problem separates and the solution is diagonal;
it returned 1 / max(rho_ii, eps) there, dropping the variance term, so with
an unpenalized diagonal it returned about 9e15 instead of 1 / S_ii -- and
every q = 1 problem takes that branch. Separately, its inner loop could not
terminate on non-finite input.X0 with two or
more columns) failed with "non-conformable arguments": B0 was built
transposed. A second bug behind it made kappa non-finite when the response
had no zeros at all. Both were unreachable before, so no working fit changes.static).First CRAN submission
print(), summary(), plot(), logLik() and BIC() for fitted models (any NormalBlockVarBase subclass), and print()/summary()/logLik()/BIC() for collections of models; accessing $loglik on a collection now raises an informative error instead of silently returning NULL.@examples, cross-referenced $plot_network()/$latent_network() in each other's documentation, and replaced a few inefficient matrix operations (solve() on symmetric positive-definite matrices, M %*% t(C)) with chol2inv(chol())/tcrossprod().ZINormalBlockVarKnownClusters/ZINormalBlockVarUnknownClusters) for data with an excess of exact zeros.NormalBlockVarCollectionSparsity, sparsity = TRUE in normal_block()).ward2, kmeans, spectral, sbm, selectable via NB_control(clustering_init = )), and best_of_inits() to try several and keep the best-ELBO fit.refine() on NormalBlockVarCollectionClusters: post-hoc split/merge search seeded from neighboring cluster counts, to escape mediocre local optima left by independent per-q cold starts.brca_rppa (breast cancer proteomics), onema (French stream fish biomass, zero-inflated), university (WebKB text data), each with a dedicated vignette.NormalBlock* to NormalBlockVar*) for consistency; NormalBlockData is unchanged.NormalBlockData rescales columns of Y by default; fitted values and regression coefficients are reported back on the original scale.ClustOfVar dependency (the kmeansvar clustering heuristic was dropped after benchmarking showed it was both the worst-ranked and least reliable of the available heuristics).Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.