Skip to content

normalblockr

0.3.0Package record

Gaussian Graphical Models with Latent Clustering Structure

0packages depend
996downloads / year
91.4%test coverage
13/13flavors OK

Overview

About

Implements the Normal-Block model, a Gaussian graphical model with a latent clustering structure for the multivariate analysis of continuous data. The model clusters variables and, building on the graphical lasso, infers a network of statistical dependencies between clusters rather than between individual variables, for known or unknown clusterings, with an optional zero-inflation extension for data with an excess of exact zeros. A complementary family clusters variables by their regression response to covariates rather than by their covariance, sharing one profile per cluster. See Tous & Chiquet (2026) doi:10.1016/j.csda.2026.108347 for the model itself and its variational expectation-maximization estimation procedure.

Changes in 0.3.0

New model family: clustering in the mean

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).
  • Zero-inflated counterparts (ZINormalBlockMeanKnownClusters, ZINormalBlockMeanUnknownClusters), and collections of those over a range of cluster counts.
Show all changes in 0.3.0Hide the rest of the changes in 0.3.0
  • 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).

The graphical lasso is now in-package

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.
  • Two bugs in 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.
  • Each M-step warm-starts from the previous one, at a tightened threshold: faster *and* closer to the optimum than the previous cold starts.

Bug fixes

  • Zero-inflation with more than one zero-inflation covariate (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.
  • Fixed two crashes on the penalized path, one of them a long-standing memory-safety bug (an R object cached in a C++ static).

Other changes

  • A collection over cluster counts no longer repeats work that does not depend on the cluster count: the OLS fit, the zero-inflation logistic regressions, and the shareable part of each clustering heuristic (one hierarchical tree cut at each q, one eigendecomposition, one lossless row compression) are computed once. Fitted values are unchanged.
  • Printed model descriptions now name the residual-covariance shape for every family, and the zero-inflated variance-block models name their family.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 8.6 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-13
  • ERROR6 OK, 1 ERROR2026-09-04
Advisories

none known

Documentation

In release 0.3.0
READMEYes · 1,326 wordsVignettesYes · 4 · dynamicNEWSYes · 100% structured · mentions 0.3.0Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
49 (8 internal)includes a package overview page
Examples that run
81%29 run in a plain check · 7 hold no code
Exported functions with examples
77%
Documented parameters
98%
Return-value docs
27%
Help pages citing references
0%

Downloads

996
CRAN downloads in the past year
Rank #10,042 · ~3/day · ~83/mo
Daily download trend is not available in this view yet.
48430 days
99690 days
9961 year
Compare downloads with other packages →
Also on31 r2u3 autocran

Repository

1Stars
0Forks
0Open issues
0Open PRs
4Releases
454Commits
2Commit identities
License file reads as GPL-3.0 · 454 commits · Last activity 2026-10-07 · Default branch at 0.3.0.9000, ahead of CRAN 0.3.0 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
91
Median days to close, 50 most recently updated closed PRs
0

Releases over time

2026-09-04 · 32026-09-12 · 4
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/jchiquet/normalblockr on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.qmdpkgdown

GitHub Pages site last deployed 2026-10-07 · The repository has a site deploy workflow

Coverage (1)
Coverage reporting
Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-06-26
    Named in .Rbuildignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 50 crediting it in the message
Models named in its commits
  • Claude Opus 536 commits · Aug to Sep 2026
  • Claude Sonnet 513 commits · Jul to Sep 2026
  • Claude Opus 5.51 commit · Sep 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
22 external dependencies (excludes base and recommended)

Installing normalblockr adds 55 packages (28 with compiled code, 54 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.

Depends (1)
R >= 4.1.0
LinkingTo (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.2.1 (2026)
Contributor · added in 0.3.0
Releases (2)

Pick two releases to compare their code metrics.

  • 0.3.0Latest
    record
    2026-09-11 · current release · diff ↗ ·
    added 9 exports
    NormalBlockMeanCollectionClusters, NormalBlockMeanCollectionClustersSparsity, NormalBlockMeanCollectionSparsity, NormalBlockMeanKnownClusters, NormalBlockMeanUnknownClusters, ZINormalBlockMeanKnownClusters, ZINormalBlockMeanUnknownClusters, generate_normal_block_mean_data, normal_block_sequential
  • 0.2.1
    record
    2026-09-03
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-09-03
Total releases
2 / 1 yrs
License
GPL (>= 3) OSI
Minimum R
≥ 4.1.0
Bundled data
509 KB / 3 files
Download size
1.5 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("normalblockr")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for normalblockr version 0.3.0 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy