NEWS


LUCIDus 3.3.1 (2026-12-03)

LUCIDus 3.3.1 merges two parallel lines of development from 3.2.1: the 3.3.0 correctness and parity release (all of it is kept; see the 3.3.0 section below) and a set of fixes that make serial LUCID with useY = FALSE and its bootstrap correct and stable. Those fixes came out of an audit of a real analysis: 4 time points, each a 3-layer parallel sub-model, with three outcomes fitted separately. Where the two lines disagreed, the rule that is correct for an unsupervised model was kept.

Changes in default behaviour

The outcome model of a useY = FALSE fit is a regression on the posterior cluster probabilities. New argument outcome_method = c("auto", "pip", "weighted"); "auto" means "pip" when useY = FALSE and "weighted" when useY = TRUE. 3.2.0-3.3.0 regressed Y on the latent states with responsibility weights. When the outcome does not inform the clusters, that estimator is attenuated towards zero by misclassification: in a simulation with a true contrast of 0.47 it returned 0.29. "pip" regresses Y on each subject's non-reference posterior probabilities plus CoY, as LUCIDus 3.1.0 did, and recovers the contrast. res_Gamma$fit$coefficients keeps the 3.1.0 names LC1..LCm, so scripts written against 3.1.0 still map the terms. Binary outcomes honour outcome_penalty = "firth". outcome_method = "weighted" reproduces 3.3.0.

Clusters estimated without the outcome are labelled without it. 3.3.0 ordered the final serial stage by its outcome effect even when useY = FALSE. The clusters are identical whichever outcome is attached, but their labels, and so the sign of every coefficient, could differ between outcomes. Every model or stage fitted without Y is now ordered by expected cluster size: cluster 1, the reference, is the largest. Near-ties are broken by the omics means (omics_order_index()). Outcome ordering is kept for useY = TRUE. This also covers the upstream stages of a useY = TRUE serial model, which never see Y: 3.3.0 ordered them by the omics means. In 3.3.1 their labels, and so the signs of their coefficients and of the next stage's transition coefficients, may flip. A new test fits the same serial model to three different outcomes and requires identical posteriors and labels.

predict_lucid() no longer lets Y move the posterior of a useY = FALSE model. Supplying Y used to switch the outcome term on in the E-step, so predicted clusters differed from the fitted ones. Y now enters only for a model that was fitted with it.

Bootstrap (boot_lucid())

Separation in the cluster-assignment models

New Beta_ridge (default 0): a ridge (weight-decay) penalty on the multinomial G -> X coefficients and, for serial models, the stage-to-stage transition coefficients (nnet::multinom(decay = )). Small samples with many layers can produce (quasi-)separated assignment models; the real-data audit saw a coefficient of -42.7 with bootstrap limits up to 153. A small value (0.01-0.1) keeps them finite.

Other fixes

Notes for users of 3.3.0

LUCIDus 3.3.0

Initial clustering selects its own geometry, and no longer collapses at high dimension

init_omic.data.model now defaults to "auto", which picks the omics covariance geometry by BIC -- per layer -- among the geometries that layer's sample size and dimension can actually identify. The previous default was the fixed "EEV", which estimates an orientation per cluster: 2,500 covariance parameters for 50 features at K = 2, and 10,000 for 100. On simulated data with six informative features among 50 and N = 600, early integration recovered clusters at ARI 0.239 under "EEV" against 0.980 under "auto"; at 100 features it was 0.024 against 0.987. "EEV" is not uniformly bad -- a parallel fit splitting 50 features into two 25-feature layers keeps it estimable, and it scores 0.987 there -- it fails specifically where it is unidentifiable, which is exactly what the new default detects.

Passing init_omic.data.model = "EEV" reproduces the previous behaviour exactly. Every other value a caller could already supply behaves as it did: a single model name, a per-layer vector, or NULL. Only the unspecified default changed. The fitted object still reports a concrete geometry, never "auto", so summary(), predict() and boot_lucid() read the same field they always did -- and because the resolved geometry is now recorded, a bootstrap replicate refits the geometry the point estimates were produced under instead of re-selecting one per replicate.

"auto" is strictly better than init_omic.data.model = NULL, which it does not replace. NULL searches all fourteen mclust geometries unfiltered; "auto" searches the same set minus those whose parameter count exceeds what the data can support. Across spherical, AR(1) and cluster-varying truths at K = 2 and K = 3 and dimensions 8 to 100, the two select the same geometry in every case, and "auto" is up to 1,923x faster (0.03 s against 55.8 s at 50 features). The geometries it skips are simultaneously the unidentifiable ones and the most expensive to fit. A hand-picked shortlist was tried first and rejected: on AR(1) data at K = 3 the BIC-optimal geometry is VVE, which no short ladder contains.

The hierarchical partition that seeds EM no longer collapses onto a single component. mclust::Mclust() starts EM from model-based agglomerative clustering under VVV, guarded only by if (n > d). Well inside n > d -- measured at n = 800, d = 75 -- that agglomeration puts ~90% of subjects in one cluster before EM takes a step, and EM then polishes the degenerate partition: minimum cluster proportion was 0.101 at 75 features and 0.129 at 150, against 0.426 and 0.487 once fixed. LUCID now supplies its own EII agglomeration, which is stable at any dimension and 2x (8 features) to 22x (100 features) cheaper, since that agglomeration was most of the initialization cost. This is supplied per call rather than through mclust.options(), so it changes nothing in the caller's session, and it honours mclust.options("subset"): supplying a starting partition bypasses mclust's own row subsampling, and agglomeration is quadratic in N, so the cap has to be respected explicitly or large cohorts pay for it -- 21 s at N = 5,000, 216 s at 10,000 and 1,462 s at 20,000 on the full data, against 1.4-1.9 s on the 2,000-row subsample mclust would have used.

The collapsed start was also a severe performance bug. A parallel fit with 50 features per layer under "EEI" took 25,198 seconds -- 7.00 hours -- and returned normally, while the same configuration under "VVV" took 2.48 s. It was not slow arithmetic: starting from a partition with ~90% of subjects in one cluster, the EM could not meet tol and burned restart after restart up to max_tot.itr. With a stable starting partition the same fit converges in 2 iterations and 0.98 seconds, with no restarts -- a ~25,000x reduction, at identical settings.

The combination removed a seed-dependence that multiple starts had been masking. On a two-stage serial fit the stage-2 transition coefficient varied by 1.543 across four seeds with n_starts = 1; it now varies by 0.002, so a single start delivers what four used to. tests/testthat/test-serial-reproducibility.R asserted spread(4) <= spread(1), which was meaningful while a single start was unstable and is now a comparison of two numbers at the noise floor; it has been restated to assert reproducibility directly, with the measured values recorded in the file.

A vector of geometries no longer fails on the early path. Mclust(modelNames = ) accepts several geometries and selects among them by BIC, but estimate_lucid() stored the argument rather than the selection, so the whole vector reached mclust::mstep() and failed with "EXPR must be a length 1 vector". It also reached fit$init_omic.data.model, where summary() needs a single name to count BIC parameters -- a vector silently reverted that count to the unstructured one -- and where all four boot_lucid() paths read it back to refit. The early path now records the geometry mclust actually fitted, as the parallel path already did. A serial fit likewise records the geometry each stage resolved, rather than echoing the caller's argument.

Unknown geometry names are now rejected with a message naming the valid set, instead of surfacing from inside mclust as "mclust failed for specified model". "auto" cannot be combined with other names in a per-layer vector, since it is a whole-model instruction rather than one layer's geometry.

The vignette figures change, and the HELIX example cannot adjudicate them. Every figure in the five vignettes was re-rendered and compared against a pre-change render. No figure broke: 21 of 23 panels are populated in both, and the two empty ones -- the methylation block of the continuous-outcome HELIX tutorial, shown as a heatmap and again as a bar chart -- are empty in both, because that layer's cluster means differ by less than 0.05 either way. Five panels changed content. The clearest is the miRNA block: before, three features separated strongly (about +/-1.5) and five were flat; now all eight separate moderately (about +/-0.8), which is what a more parsimonious covariance geometry does -- it spreads the signal over features instead of concentrating it on a few directions. simulated_HELIX_data carries no latent cluster truth, so neither solution can be shown to be the right one on that data. On simulated data that does carry a truth, automatic selection is equal or better. Readers using the HELIX tutorial as a worked example should know the figures are a different, equally defensible solution rather than a corrected one.

What this does not fix. Geometry selection is not a remedy for clusters that are not separated. At N = 800 with 50 features and AR(1)-correlated signal, the correlation collapses the between-cluster Mahalanobis distance and both "auto" and NULL select EII and reach ARI 0.000. "auto" is identical to exhaustive search there, not worse; the claim is that it finds the best available geometry cheaply, not that it recovers clusters in any regime.

Correctness

boot_lucid()'s estimate column is the supplied model's own coefficient for parallel and serial fits, not a throwaway refit's. boot::boot() derives t0 by calling the statistic on the unpermuted rows, which refits the model under a fresh seed and can land on a different local optimum. Only the early branch replaced it, so for a parallel or serial fit every CI table reported that refit's estimates and centred every normal interval on them (boot.ci(type = "norm") uses 2*t0 - mean(t)). On a two-stage serial fit the transition coefficient printed as 9.5698 where the model's own estimate is 9.7627; with init_par = "random" a parallel fit's cluster-to-outcome effects came out as -0.0856/1.0879 against the model's 0.9897/0.3401. All three branches now take t0 from the model, and a t0 that cannot be extracted raises an error instead of silently blanking the whole table with NAs.

Bootstrapping a lucid() fit made with a penalty no longer describes a different model than the point estimates. lucid() refits on the surviving features and then restores the tuned penalties on $Rho for reporting; boot_lucid() read that same field, concluded the model was penalized, warned, and refit at zero penalty on whatever G/Z it was handed -- the full feature set. With Rho_G = 0.05 the fit had 4 exposures, summary(fit) printed 4, and summary(fit, boot.se = ) printed 10, with different point estimates. The penalty a fit's estimates were actually produced under is now recorded separately as $Rho_fit (zero after a selection refit), which is what boot_lucid() reads, and the bootstrap data is narrowed to the fitted feature set from $selection.

align_replicate_serial() no longer silently discards cluster alignment for 3-or-more-stage models. perms[[s]] <- NULL deletes a list element and shortens the list, so the re-referencing loop -- which indexes perms positionally -- read the wrong stage's permutation or ran off the end (subscript out of bounds at n_stage >= 3). The tryCatch added in the previous release swallowed that error, so the replicate was used completely unaligned, re-introducing exactly the label-switching contamination the alignment exists to remove. Fixed with perms[s] <- list(NULL); an alignment failure now warns, naming the model type, instead of passing unnoticed.

Bootstrap replicate validity is assessed per parameter, not per replicate. normalize_parallel_beta()/normalize_parallel_mu() deliberately NA-fill cells they cannot resolve, and one such cell marked every replicate invalid, yielding an all-NA CI table plus the misleading "Only 0 valid bootstrap replicate(s) remain". Replicates whose refit failed outright are still counted and warned about; a parameter with too few finite estimates now loses only its own interval.

f.binary.parallel() no longer mixes two models in one table. It took the gamma column from the model and only the bounds from the bootstrap, so the printed estimate and the interval around it could come from different fits, and any row whose name failed to match became an all-NA line. It now consumes the CI table whole, as f.binary.early() and f.normal.parallel() already did.

f.normal.early() strips the "Y." prefix a serial model's final stage adds, so a serial normal fit no longer prints Y.LC2 under boot.se = and cluster2 without it. This is the other half of 3.2.1's f.binary.early() fix.

summary() on a one-stage serial model no longer crashes. seq.int(2, n_submodels) with one submodel is c(2, 1), so the loop ran with i = 2 and dereferenced submodels[[0]]: "attempt to select less than one element in get1index ". Same pattern fixed in build_serial_transition_labels_boot().

An omics feature with no observed value in any row is now rejected with an error that names it. The LOD initializer deliberately leaves such a column NA (there is no observed minimum to halve) and check_na() only warns above 50% missing, so mclust received NA and failed with "missing value where TRUE/FALSE needed", which tune_lucid() then reported as "LUCID model fails to converge given current tuning parameters" -- pointing the user at the penalty grid instead of at their data. Affected all three integration strategies. The check runs before tuning, and tune_lucid()'s all-candidates-failed message now distinguishes a structural data problem from non-convergence.

The "log-likelihood decreased ... this indicates a numerical problem" warning no longer fires spuriously on every penalized parallel fit. The parallel EM's convergence and dip checks used the unpenalized log-likelihood while its M-step maximized the penalized one, so a Rho_G-penalized fit emitted the warning on iteration after iteration for a decrease that is simply what penalization does. The loop now ascends a penalized objective (parallel_penalty_value(), which penalizes the precision matrix as glasso does -- the dead accounting inside Mstep_XtoZ() penalized the covariance and was never read), and fit$likelihood and loglik_trace remain the observed-data value. Where a dip past the tolerated slack does occur, the message now says what it means: the imputation step is a majorization and the penalized mean/covariance updates are approximate maximizers (est_mu() is a single coordinate sweep), so small decreases are expected and a large one points at a penalty too strong for the data. It is also reported once per fit with a total, rather than up to 500 identical warnings.

summary.early_lucid()'s mu slice keeps its dimensions (drop = FALSE), and summary_lucid_auxi()'s beta slice no longer recycles a short logical index: c(TRUE, s1) is shorter than res_Beta's 1 + dimG + dimCoG columns, so with CoG present R recycled it and silently kept the wrong columns.

has_unselected_feature() reads a parallel layer's selectZ as a feature mask. It is a K x M per-cluster matrix, so a feature retained overall but with a near-zero mean in one cluster blocked the bootstrap outright. Conversely selectG_layer was never checked, so an exposure dropped in one layer but kept in another passed undetected. Both fixed.

align_boot_vector() matches names partially instead of falling back to positional filling for the whole vector. One unmatched name discarded name alignment for beta, mu and gamma together and refilled by position -- indistinguishable from a correct replicate. Matched parameters are now placed, the rest are left NA (and lose only their own interval), and a warning names the offenders.

estimate_lucid() rejects a negative penalty instead of treating it as "selection requested" via != 0 and handing it to glmnet/glasso. lucid() already rejected negatives.

Mstep_GtoX() no longer leaks layer 1's cross-validated lambda into later layers. With penalty = NULL, assigning the CV result back to penalty meant layers 2..n were penalized at a lambda chosen for layer 1's data. Each layer now cross-validates its own, and the per-layer values are returned.

boot_lucid() now aligns bootstrap replicates when a serial model's upstream stage is itself a parallel submodel. align_replicate_serial() previously only re-referenced a downstream stage's transition coefficients when the upstream stage was an early-integration submodel; a parallel upstream stage's replicate-to-reference cluster permutation was silently discarded. A serial model with any parallel stage before its last now gets the same bootstrap-CI correction early-only serial chains already had (cluster labels aligned to the reference fit before coefficients are stacked across replicates) for every stage-type combination.

estimate_lucid(lucid_model = "parallel", max_itr = 0) no longer crashes. The parallel EM loop's bound (itr < max_itr) skipped the loop body entirely at max_itr = 0, so res_Beta/res_Mu_Sigma were never assigned and the fit failed with "object 'res_Beta' not found" instead of the documented max-itr-exhaustion warning the early-model branch already gives in the same situation.

get_selected_G()/get_selected_Z()'s layer argument now accepts a layer name, as already documented, instead of only an integer index.

tune_lucid()/lucid() no longer crash when verbose is forwarded through .... verbose_tune already controls estimate_lucid()'s own verbosity during tuning; a caller who also passed verbose (e.g. lucid(..., verbose = TRUE)) previously hit R's "formal argument matched by multiple actual arguments" error. The colliding value is now dropped (with a warning pointing at verbose_tune) instead of crashing the call.

summary_lucid_auxi()'s parallel branch no longer discards a supplied boot.se (previously hard-coded to NULL).

Cluster labelling

(Amended in 3.3.1: the outcome ordering described here applies when the outcome is used to fit the clusters, useY = TRUE. Models and stages fitted without Y are ordered by expected cluster size; see the 3.3.1 section.)

The cluster-labelling contract is now pinned for every model type and both outcome families. A mixture model's cluster labels are arbitrary, so LUCIDus fixes them: the clusters that feed the outcome model are relabelled in order of increasing outcome level, and every cluster-indexed block is permuted with them. The behaviour was already in place; what was missing was coverage, and with it any guarantee that it held outside the early model with a continuous outcome. It is now asserted for early, parallel and serial, for family = "normal" and "binary", with no missingness, sporadic missingness and list-wise missingness, and through the bootstrap.

What the contract guarantees, and is now tested:

Single-feature omics blocks are rejected, with a usable message

An omics block must be a dataset of at least two features, and a block with one is now refused on input. LUCID clusters a multivariate omics profile, so a single feature gives the model nothing to find structure in; mclust also reports one-column data in a univariate form (model names "E"/"V", means as a length-K vector, variances as sigmasq) that the EM does not consume.

Previously such a block was accepted and then failed deep inside the algorithm -- "subscript out of bounds" raised inside mclustBIC at initialization, or "incorrect number of dimensions" several EM iterations later -- both reaching the user through the "fails to converge given current tuning parameters" wrapper, which points at the penalty grid rather than at the shape of the data. check_omics_estimable() now rejects it up front, naming the offending layer or stage (by name where the block is named) and saying what is required.

A penalty that would leave fewer than two omics features is treated as a degenerate selection rather than fitted. This is the path that made the problem reachable from ordinary use: variable selection refits on the surviving features, so a strong enough Rho_Z_Mu/Rho_Z_Cov produced a one-feature block, and it broke lucid()'s own documented selection example. The existing all-features fallback now applies at a minimum of two rather than one, warns that the penalty is too large, and records the outcome in $selection as degenerate. Exposures are unaffected: G is not clustered, so a single surviving exposure is still a valid fit.

Verification: penalized estimators, the BIC contract, and figure geometry

The penalized M-steps now have oracle coverage. Eqs 14-16 were previously checked only through their consequences. Eq 14 (the G -> X lasso) and Eq 16 (the glasso covariance) are solved by external optimizers, so they are verified against the optimality conditions the equations assert -- independent of the algorithm that found the solution -- and Eq 15 (the soft-thresholded cluster mean) against a derivation written from the objective, which it matches to 1.3e-15. Each oracle is mutation-tested, so it demonstrably fails on a wrong answer rather than merely passing on a right one.

One subtlety is now encoded rather than left implicit: est_mu() performs a single Jacobi sweep, updating each coordinate against the incoming mu, so it is an approximate maximizer by design and a stationarity check fails against it even at Rho_Z_Mu = 0.

The BIC counting contract is pinned, and no BIC value changes. That Rho_Z_Cov earns no degrees-of-freedom credit is Eq 18's own definition -- D - D_G - D_Z credits deselected variables, never covariance entries -- so crediting glasso sparsity would be an extension beyond the paper; a test now sparsifies the precision matrix and asserts the parameter count does not move. The geometry-aware covariance count stays opt-in, with both paths tested. summary() now prints the basis beneath the number:

  BIC                    : 7621.83
    basis: Eq 18 (one df credited per deselected variable), unstructured
           covariance count; not comparable across lucid_model

Sankey figures are tested against the layout engine they actually ship. With V8 available (now in Suggests; the tests skip without it), networkD3's own bundled d3.sankey runs headlessly, so the rendered column structure, node heights and link widths can be measured rather than predicted. This confirms the R port of the layout that four existing tests depend on, and checks that link width stays proportional to |effect| and that nodes neither overlap nor leave the canvas.

Degenerate selections are now reported

When a penalty retains too little to fit, the model is refit on the whole block -- and that is now said out loud. The fallback itself is unchanged and correct; what was missing was any way for a user to know it had happened. $selection recorded degenerate_G/degenerate_Z, but nothing read them, so the recorded mask -- which describes what the penalty did -- was presented as though it described the fitted model. At Rho_G = 0.2 on sim_data, get_selected_G() returned all-FALSE ("no exposure was selected") for a model that had used all 10 exposures, with no warning and no mention in summary().

Rho_G's mapping onto glmnet's penalty scale was checked while fixing this and is monotone (10 -> 8 -> 7 -> 5 -> 4 -> 4 along glmnet's own path; 6 -> 5 -> 4 -> 4 -> 0 end to end, the zeros flagged degenerate), and the single-lambda glmnet() call in the G -> X M-step agrees with a warm-started path fit to 2.6e-5, so it was left as it is. A development note in the 3.3.0 report claimed otherwise; it has been withdrawn, and the monotonicity is now a test.

Parity across integration strategies

Variable selection now follows one contract for all three strategies. lucid() previously refit on the selected features and recorded what was dropped for "early" only -- its flag_select_G/flag_select_Z were declared inside the early branch. A penalized "parallel" or "serial" fit returned the penalized candidate straight from tune_lucid(), so the coefficients a user read off it were shrunk towards zero (with Rho_Z_Mu = 40, Rho_Z_Cov = 0.4 a layer's means came back at -0.798 where the unpenalized value is -1.006, and a second layer was zeroed entirely), with nothing on the object recording which features had been dropped. All three now select, refit unpenalized on the survivors, and record $selection -- in the original feature space, so FALSE marks a dropped feature. The refit carries the tuned fit's init_omic.data.model, init_impute, init_par, n_starts and outcome_penalty forward, which lucid()'s early refit previously dropped unless they happened to be routed through ....

get_selected_G()/get_selected_Z() answer in the original feature space. They read $select, which after the refit describes the reduced dimensions and is all TRUE -- so on a fit that dropped 6 of 10 exposures they returned 4 TRUEs and the dropped exposures simply vanished rather than appearing as FALSE. $selection, the honest record, had no readers anywhere in the package. They now prefer it and fall back to $select for estimate_lucid() output, which is never refit. get_selected_Z(stage = ) is validated the way layer = already was.

A penalty that selects nothing now warns. lucid() fell back to using every feature and then overwrote the record with an all-TRUE mask, indistinguishable from "the penalty dropped nothing" -- the only signal was a cat() gated on verbose_tune. It now warns and records degenerate_G/degenerate_Z in $selection.

tune_lucid() tunes penalties for serial models. It refused a penalty vector outright ("Tune LUCID in serial can't tune for multiple regualrities for now!"), so a serial model could be fit with a penalty but never tuned over one. A serial grid now crosses the K candidates with the penalty combinations, scored by the same per-stage BIC sum, each candidate wrapped in try(). Rho_G applies to stage 1 only, since a later stage's "G" is the previous stage's cluster probabilities rather than an exposure. The serial tuning table also gains proper column names and the Rho_G/Rho_Z_Mu/ Rho_Z_Cov columns its own documentation already promised -- it was an unnamed one-column list-matrix plus bic.

The two selectZ criteria agree. The early M-step tested whether a feature's cluster means differ (diff(range(mu)) > 0.001) while the parallel M-step tested whether each cluster's mean is non-zero. A feature with identical but large means across clusters was therefore deselected by early -- and dropped from its refit -- although the penalty had not shrunk it at all. Eq 18 defines D_Z as the variables "whose effect estimates are 0 across all latent clusters", so the early branch now uses the zero rule too. This changes which features an early penalized fit drops in that one case.

plot() works for parallel and serial models. Both methods raised "The plotting function of LUCID in Parallel and Serial is still under development". plot.lucid_parallel() now draws exposures into each layer's own clusters, those clusters into that layer's omics features, and every layer's clusters into the shared outcome; plot.lucid_serial() follows the chain, drawing each stage's transition coefficients into the next stage's clusters and the final stage's clusters into the outcome. Both share plot.early_lucid()'s visual language and appearance options. Cluster nodes are labelled with their layer or stage, and an omics feature name occurring in more than one block is prefixed so the two stay distinct nodes.

Two things were needed to make those diagrams publication-ready rather than merely drawable. A reference cluster no longer floats into the exposure column. Its coefficients are all zero by construction, those zero-magnitude links were being dropped, and the Sankey layout -- which takes a node's column from the longest path into it -- then placed a cluster node at the left edge among the exposures. Zero links are now kept (as plot.early_lucid() always did), so a parallel fit draws every layer's clusters in one column, as the parallel topology requires, and a serial fit reads as a clean left-to-right chain. New link_scale argument. Link width is proportional to |effect|, but a Sankey has one width scale and LUCID's coefficient blocks do not share one: exposure-to-cluster links are multinomial log-odds, cluster-to-omics links are cluster means, and a serial model's cluster-to-cluster transitions are regressions on a posterior probability confined to [0, 1], which makes them tens of times larger -- 53x the median link on the package's own example data. Left raw, they crush every other link to a hairline. The default stays "raw" (the published convention, and plot.early_lucid()'s output is unchanged), but it now warns when one block's magnitudes dwarf another's by more than 20-fold, and link_scale = "within_block" divides each block by its own maximum for a figure that can actually be read.

A serial diagram now draws the pathway alone by default. plot() on a serial fit shows G -> X1 -> ... -> Xm -> Y and no omics features, because that is the structure a serial model exists to express and the one a Sankey can show unambiguously -- see the next entry for why the omics could not simply sit alongside. The omics arm is reachable with omics = "aggregate" (one node per stage and layer), "features" (every feature) or "per_stage" (the original layout), and belongs properly to plot_cluster_omic_profile(), which ranks each stage's features by how strongly they separate its clusters.

Serial figures also default to link_scale = "within_block", where the other methods default to "raw". A serial model's cluster-to-cluster transition coefficients regress on a posterior probability confined to [0, 1], so on one shared width scale they run 73x the largest exposure effect on this package's own example data (max/median width spread 72.5) and flatten the rest of the chain to hairlines. Each block is now scaled by its own maximum (spread 1.0, and no warning); link_scale = "raw" restores the unscaled widths and the warning that explains them. plot.early_lucid() keeps "raw", matching the published R Journal figure, and plot.lucid_parallel() keeps it too -- its blocks are already comparable.

A serial diagram's columns no longer mix latent clusters with omics features (relevant to the non-default omics modes above). A Sankey takes a node's column from the longest path into it, and networkD3 exposes no way to override that (no nodeAlign/nodeDepth argument, and it drops any extra Nodes column). So stage s's omics features landed in the same column as stage s+1's clusters: on a six-stage, two-layer fit, five of the eight columns each held 6 omics leaves beside 4 cluster nodes, and no column meant one thing. plot.lucid_serial() now takes omics, defaulting to "aggregate": one omics node per stage (per stage and layer when the stage is a parallel sub-model), labelled with its feature count, with all of them pushed into a terminal column. That figure drops from 68 nodes to 44, has no mixed column, and its tallest column is 13 rather than a 37-node wall. The link into an aggregate node carries, per cluster, that cluster's largest mean in absolute value with the sign kept -- the strongest separation the block offers, the notion plot_cluster_omic_profile() ranks features by, and documented as a derived summary rather than a coefficient. omics = "features" keeps every feature (no mixed column, tall terminal column), "none" draws the bare chain, and "per_stage" is the original layout, kept reachable and documented as the one that mixes columns.

Fixing that exposed a second ordering defect of the same kind as the reference-cluster inflow bug above. Stage s's predictor is the vector of stage s-1's non-reference cluster probabilities, so a reference cluster has no transition coefficient and therefore no outgoing transition link; with the omics leaves pushed right, networkD3's rule "if all my targets are sinks, I belong near the right edge" then dragged every reference cluster out of its own stage and piled 14 of them into one column, splitting each stage's clusters across two columns. The fixed-at-zero contribution is now drawn as a zero-width link, exactly as the inflow case is, so each stage's clusters stay together.

plot.early_lucid() and plot.lucid_parallel() are untouched -- parallel has no mixed column, and is provably identical under either alignment mode.

Worked diagrams for all three strategies are in the vignettes: the continuous- and binary-outcome 3-model tutorials each draw early, parallel and serial side by side; lucidus_full_functionality_guide shows the three with their node/link counts and explains how to read each topology; and serial_6stage_parallel_monotone_missing_tutorial draws the hardest case the method handles -- a six-stage chain whose every stage is a two-layer parallel submodel.

fit$Z means the same thing for every strategy. It was the fitted (imputed) omics for early and parallel but the raw input, NAs intact, for serial -- so strategy-agnostic code had to know which. A serial fit now stores its per-stage fitted blocks, still also reachable at submodel[[i]]$Z.

check_na() accepts lucid_model = "serial", returning a per-stage breakdown; previously it was an error, even though a serial fit is where a per-stage missingness picture is most useful. Its high-missingness warning now names the layer or stage it is about -- a parallel fit reached the unlabelled early branch once per layer, with no way to tell which -- and carries a condition class, so tune_lucid() reports it once for the whole grid instead of once per candidate per start per replicate.

A parallel fit's missing_summary carries the cross-layer view that check_na()'s own parallel branch computes but no fit ever reached: the proportion of missing cells pooled over layers, rows_missing_any_layer, rows_missing_all_layers, and the joint across-layer pattern counts. The joint view is what distinguishes a subject missing one whole layer -- who still contributes to every other layer's E-step -- from one missing all of them.

A serial fit's missing_summary carries carried_forward: per stage, how many subjects had no observed omics value at all. From stage 2 on, a stage's "G" is the previous stage's posterior cluster probabilities, and such a subject enters with full weight even though its posterior there carried no omics information. Nothing recorded this, so the limitation was invisible; it is now reported and documented.

A fit scores its own imputation. check_imputation_quality() was exported but never called, so a fit whose imputed values landed far from the observed ones reported nothing. When anything was imputed, missing_summary now carries imputation_quality (per layer for parallel) and a failing score warns. The score is computed from the observed-cell indicator the fit already has, so no copy of the raw data is carried through the EM loop.

A serial summary reports model_info$K and model_fit$n_parameters, which early and parallel already did; summary(fit)$model_info$K was NULL for serial alone, and no serial parameter count existed at all.

The residual standard deviation of a continuous outcome is printed. The BIC charges one per cluster for an early fit and one overall for a parallel fit, and neither was shown anywhere, so a reader could not see the within-cluster outcome spread the cluster means sit in.

Documentation

BIC's parameter counting is documented, and a geometry-aware count is available. The covariance contribution is charged as K*M*(M+1)/2, the unconstrained count, regardless of the mclust geometry actually fitted (init_omic.data.model, default "EEV", has 25 free parameters where this charges 30 at M = 5, K = 2; "EII" has 1). That inflates BIC, biases K selection towards smaller K, and within one penalty grid favours penalized candidates, which really do estimate unstructured/glasso covariances. The default is unchanged so previously reported values reproduce exactly; set options(LUCIDus.geometry_df = TRUE) or pass summary(fit, geometry_df = TRUE) for the geometry-aware count. ?summary_lucid now also records that Rho_Z_Cov earns no degrees-of-freedom credit (so tuning it alone can only raise BIC), that Eq 18 subtracts one per deselected variable rather than its whole block, that a lucid() fit's reported BIC is computed on the refit's reduced dimensions and so need not equal the tuning table's, and that BIC is not comparable across lucid_model.

The sporadic-missingness likelihood convention is documented. Under integrated imputation the missing cells are treated as parameters, so once imputed the density is evaluated at full dimension and fit$likelihood is that objective rather than the observed-data likelihood: it is not comparable across datasets with different amounts of missingness, and the BIC inherits that (the imputed cells are not counted as parameters and N is charged in full). predict_lucid() instead marginalizes over missing coordinates, so the same subject's posterior can differ between fit time and predict time. Neither is wrong; they are different, deliberately, and now said so in ?estimate_lucid.

safe_impute()'s role is stated correctly. Its own documentation and the fill_data() @seealso described it as what initializes the EM algorithm. It is not: initialization is init_impute (fill_data_lod() or mclust::imputeData), and nothing in the package calls safe_impute(). It is a user-facing utility, and the docs now say so.

boot_lucid()'s @return describes what each model type actually returns. It promised beta/mu/gamma for every type, but a serial result carries only stage and bootstrap. The new text also records that only normal and percentile intervals are computed (never BCa), that the normal limits are bias-corrected and so need not bracket estimate, and the new conf and boot_status components.

Stale claims removed. R/lucid.R's "No regularity feature for LUCID in parallel, All Z are selected" and two "not having regularity yet, to be added" comments in R/summary.R were all false by 3.2.0. ?lucid, ?tune_lucid, ?estimate_lucid, ?check_na, ?get_selected_G, ?get_selected_Z, ?summary_lucid and the plot methods are updated throughout, and boot_lucid/tune_lucid gain worked parallel and serial examples.

Binary-outcome separation diagnostics and Firth's penalized logistic regression

New: estimate_lucid() warns when a cluster's outcome coefficient shows signs of (quasi-)complete separation from a binary Y. LUCID's whole purpose is finding clusters that associate with Y, so at small N a cluster can end up (quasi-)perfectly separating the outcome -- an expected risk, not a sign the fit is wrong. In that regime the logistic MLE is finite but numerically extreme (very large odds ratios with very wide, unreliable confidence intervals), and empirically R's own glm() "fitted probabilities numerically 0 or 1"/"did not converge" warnings do not reliably fire under the soft, continuous cluster-responsibility weights the outcome M-step uses -- so estimate_lucid() now checks cluster-effect coefficient magnitude directly (|log-odds| > 10) and warns once per finished fit, for both the early and parallel model types, rather than silently swallowing glm()'s own (unreliable) signal as before.

New outcome_penalty = c("none", "firth") argument to estimate_lucid() (and threaded through tune_lucid()/lucid()/ boot_lucid()). "firth" fits the binary outcome model with Firth's penalized-likelihood logistic regression (via the new Suggests dependency logistf) instead of plain glm(), which keeps every outcome coefficient finite and well-behaved under separation instead of just warning about it, at the cost of a small bias toward the null on every outcome coefficient (this is Firth's global bias-variance tradeoff, not something applied only when separation occurs). Applies to the early and parallel model types, and to a serial model's final (outcome-bearing) stage; rejected with a clear error for family = "normal", which has no separation to correct for. Default ("none") behavior is unchanged.

fit_early_outcome()'s binary-outcome glm() call now uses glm.control(maxit = 100), matching fit_parallel_outcome()'s existing explicit value (previously relied on R's implicit default of 25), so the two model types are not needlessly inconsistent under a very slow-to-settle fit.

Performance

boot_lucid() can run bootstrap replicates in parallel. New parallel ("no" / "multicore" / "snow"), ncpus, and cl arguments are forwarded to boot::boot(). Each replicate is an independent LUCID refit, so wall time drops roughly ncpus-fold. The default stays "no" (serial, identical to before). For reproducible parallel runs, set RNGkind("L'Ecuyer-CMRG") and a seed before the call. The point estimate (bootstrap$t0) is unchanged.

tune_lucid() can fit its grid in parallel. Same parallel / ncpus / cl arguments; grid points are independent fits. The tuning table, the fitted candidate list, and the selected model are byte-for-byte identical to a serial run -- only the interleaving of console messages can differ.

Vignette: the comprehensive-guide vignette (lucidus_full_functionality_guide.Rmd) gains a "Running the bootstrap and tuning on multiple cores" section with a worked parallel = "multicore" boot_lucid() / tune_lucid() example and the RNGkind("L'Ecuyer-CMRG") reproducibility note.

One redundant E-step removed from every EM iteration. estimate_lucid() recomputed, at the top of each iteration, the exact E-step it had already evaluated at the end of the previous one (same parameters, same imputed Z, and Estep() has no iteration-dependent term). That value is now carried forward. Converged estimates, the log-likelihood trace, and iteration counts are unchanged; the per-iteration cost of the E-step (per-cluster Cholesky / eigen and multivariate-normal density evaluation) is roughly halved.

New dependency: parallel (base R) is now imported.

LUCIDus 3.2.1 (2026-09-02)

A correctness follow-up to 3.2.0, focused on boot_lucid() and summary().

Bootstrap CIs now align cluster labels. Each bootstrap replicate is an independent refit whose latent cluster k need not be the point estimate's cluster k. Replicate coefficient vectors were stacked by name/position anyway, so any coefficient whose canonical cluster ordering was weakly identified -- a parallel layer with a near-null cluster-to-outcome effect, an upstream serial stage ordered by a single omics feature -- could get a bimodal or sign-split interval spanning orders of magnitude. boot_lucid() now permutes every replicate's clusters to match the reference fit (by posterior-probability overlap on the resampled subjects) before extracting coefficients, so each interval brackets its own point estimate. The point estimate (bootstrap$t0) is unchanged.

summary() bootstrap CI tables.

Log-likelihood labeling. The "Finished LUCID ... model: penalized log-likelihood = X" completion message printed the unpenalized observed-data value; it now says "observed-data log-likelihood". em_control$loglik_trace is the unpenalized observed-data log-likelihood for every model type (it was the penalized objective for a penalized early fit), so its last value equals $likelihood; the penalized objective still drives the internal convergence/dip check.

LUCIDus 3.2.0 (2026-09-01)

This release follows directly on 3.1.0's correctness pass. It narrows the exported API to what a user actually calls, adds four extractor functions for a fitted model's output, marks statistically significant bootstrap CI rows in summary(), fixes several consistency and reliability issues across model types, and reworks the tutorial vignettes into a polished, user-facing set built entirely on the public API.

Breaking change. Five numerical-stability helpers (check_and_stabilize_sigma(), safe_solve(), safe_log_sum_exp(), check_convergence(), safe_normalize()) and fill_data() are no longer exported. They were internal EM building blocks that happened to have a CRAN manual page; their behavior is unchanged, and they remain reachable as LUCIDus:::fn(...) for anyone who was calling them directly. The bare plot() S3 generic LUCIDus declared is also removed -- graphics::plot() already provides it, and plot.early_lucid() etc. still dispatch normally.

New: model-type autodetection. predict_lucid() and boot_lucid() no longer require lucid_model -- it is now optional and is auto-detected from class(model). Explicitly passing it still works exactly as before (including the existing mismatch error when it disagrees with model's class), so no existing call site is affected; it simply becomes unnecessary to specify.

New: extractor functions. Four new functions read directly off a fitted model and auto-detect early/parallel/serial themselves, so no branching on model type is needed at the call site:

New: significance markers in summary(). Every bootstrap CI table summary() prints when boot.se/se is supplied -- the exposure-to-cluster table, the cluster-to-outcome table, and the cluster-specific omics-mean table -- now includes a sig column marking rows whose normal-theory interval excludes 0 with "*".

Bug fixes. The serial model's returned object is now consistent with early and parallel: it reports a likelihood and a select field the way the other two model types always have, a stray unused Rho_G penalty is no longer silently applied where it has no exposures to act on, and its console progress messages use the same wording and level of detail the other two model types use. Several input-validation gaps that only showed up for specific model types or specific entry points (estimate_lucid(), tune_lucid(), predict_lucid(), boot_lucid()) are closed, so a bad input is now reported with a clear message regardless of which model type or function it went through, rather than surfacing later as a confusing downstream error.

Reliability. Convergence checking is now handled by a single, shared routine for every model type, and the optimizer's log-likelihood is checked at every iteration to confirm it is actually improving, with a warning if it ever isn't. A handful of tuning and bootstrap code paths that could previously abort an entire multi-candidate run over one bad candidate now skip that candidate and continue, matching how the other paths already behaved.

Internal. Every internal (non-user-facing) function in the package now has real documentation explaining what it does, and source files have been reorganized and renamed so that related functionality lives together and file names describe their contents -- neither change affects behavior, and both are aimed at making the package easier to review and maintain. Several long-unused, dead code paths were also removed.

Vignettes. helix_early_parallel_workflow.Rmd is replaced by two files, lucid_3models_normal_outcome.Rmd and lucid_3models_binary_outcome.Rmd, split by outcome family (both still demonstrate all three model architectures). Every vignette is rewritten as a user-facing tutorial: custom code that reimplemented feature-selection extraction, hard cluster assignment, or omics-importance ranking is replaced by the new extractor functions and lucid_model autodetection, sections that walked through internal-only functions (fill_data(), the numerical-stability helpers) are removed, and each major step gains an explanation of what it does, why it's needed, and how to read its output.

Packaging. The README.md is no longer shipped inside the package tarball (it remains in the source repository), and the paper-reproduction vignette (rjournal_paper_examples.Rmd) is no longer part of the package. Example, vignette and test runtime is trimmed so a full R CMD check completes well within CRAN's time budget: heavy examples run on small data subsets with capped EM iterations, vignette bootstrap sizes are reduced, and essentially the whole model-fitting regression suite is marked skip_on_cran() -- those tests still run in full locally and in CI; only the fast oracle, input-validation and tightly-capped smoke tests run on CRAN.

LUCIDus 3.1.0 (2026-03-11)

This release is a correctness pass over the estimation, missing-data, prediction, model-selection and inference paths, validated against the statistical definitions in the two LUCID papers:

Corrections to results reported by earlier versions

These change numbers that version 3.0.x produced. Analyses run with 3.0.x may need to be re-run.

Bug fixes

New features

Documentation

The reference documentation was reviewed against the code function by function. The substantive corrections:

Internal