stanimal (development version)
- The worked examples are now vignettes (
browseVignettes("stanimal")), and the package has a website with the reference and the vignettes as articles, https://diogro.github.io/stanimal/. The vignettes are precomputed, so building or checking the package does not fit any model. The scripts they replace are gone fromexamples/, which keeps the long simulation studies and cross-package comparisons.
stanimal 0.9.0
-
lmm_animal()andlmm_animal_laplace()gaincorrelation_prior. The default"lkj"is the existing prior."size"writes each correlation matrix of an unstructuredGandEas one dense size factor plus an LKJ remainder,D (l l' + R) D, with loadings pooled around a mean loading the data estimate, so that traits sharing a size axis are no longer all shrunk toward zero correlation. In simulations of size-dominated traits the LKJ fits recovered about half the true genetic correlations and heritabilities, and the size prior recovered them with nominal coverage, matching or beating fits tosize_shape()scores."shared_size"also givesGandEone standardized loading pattern. Both useparametrization = "h2"and reportrho_G,rho_E,sigma_size_G,sigma_size_E,size_loadings_G,size_loadings_E,integration_Gandintegration_E. Fits recordcorrelation_prior. -
animal_prior_draws()gainscorrelation_prior, andplot_prior_posterior()andplot_forest()rebuild the size prior from the recorded configuration. Older fits without the attribute are read as LKJ fits.
stanimal 0.8.3
-
fit_loo()gainstransform, which moves the terms of a fit tosize_shape()scores onto the original traits, soloo_compare()can set a size-shape fit against a fit to the raw traits. The scores are one linear map of every individual’s traits, so the change is a single constant per term (the Jacobian of the map and the change of standardization), exact for a complete response with every shape axis kept. Responses completed before the rotation, fewer shape axes, and atransformwhose scores are not the fit’s response are refused. The result carriesattr(, "scale") = "traits".
stanimal 0.8.2
fit_loo()now leaves out one individual at a time for animal fits, and works with missing trait records. Relatives share breeding values, so the animal model does not factorize over individuals; each term is the conditional density of an animal’s observed traits given every other animal, computed after the fit from the draws ofG,E,betaandY_mis(the non-factorized LOO of Bürkner, Gabry & Vehtari 2021). An animal’s own gaps are integrated out and the others’ are conditioned on at their sampled values, which keeps the importance sampling exact. Before, the terms were records rotated by the eigenvectors ofA, which are not animals, and fits with gaps were refused. That criterion remains asunit = "record"(complete responses only). ELPD values from earlier versions are not comparable with the new default.eigen_Askips the decomposition ofA, andattr(, "units")names the animal of each term. Custommodel_filefits needunit = "record".opossum_grmis now VanRaden’s genomic relationship matrix,Z Z' / (2 sum p (1 - p)), the same matrixgenomic_relationship()returns for these markers. It wasZ Z' / m, 2.86 times smaller, with a diagonal near 0.37 instead of about 1, so aGfitted on it was the covariance for a relationship no animal had:Gand the heritabilities came out inflated. Fits on the old matrix are not comparable with fits on the new one; genetic correlations depend on the scale only through the prior, so they change little.Chains start from
init = 1, a draw on (-1, 1) on the unconstrained scale, instead of the engines’ (-2, 2). The chains still start apart, soRhatcan detect a mode that only some visit, but a correlation factor over many traits no longer starts nearly singular. With 35 traits the wider start stalled every chain (step size ~1e-21, 27% divergent transitions) in 5 of 5 seeds;init = 1andinit = 0.5started all of them cleanly. Passinitthrough...to override.The unstructured
lm_phen_cov()model no longer multiplies out its Cholesky factor and factorizes the product again for each pattern of observed traits. A pattern that observes every trait uses the factor directly; an incomplete one takes it from a QR decomposition of the factor’s rows. Refactorizing failed in floating point when the factor had tiny diagonal entries, so a 35-trait fit could reject every initial value. This regressed in 0.8.0 with incomplete trait records, and complete-data fits also save oneK x KCholesky per gradient.The default
adapt_deltadrops from 0.99 to 0.9 forlm_phen_cov()and forlmm_animal(genetic_structure = "factor")with an unstructured or diagonal residual. Those fits run 2 to 3 times faster in the examples with no divergences. Univariate, unstructured-Gand shared-factor fits keep 0.99: at 0.9 the unstructured model diverged in about half of the power-simulation fits at 48 or 96 animals, and the shared-factor test fit in 6 of 10 seeds.lmm_animal()’scontrolnow defaults toNULL, which picks the target from the structure. Passcontrol = list(adapt_delta = 0.99)for the old behaviour everywhere.Laplace fits (
lmm_animal_laplace(),lm_phen_cov_laplace()) label their summary and draws with the column names ofYandX(G[wing,tail],h2[tail],beta[tail,size]), asfit_draws()names sampler fits, and record them asy_namesandx_names. An unnamedYkeeps Stan’s indices. Code that looked quantities up asG[1,1]on a namedYmust use the names.
stanimal 0.8.1
Bug fixes
- Two fits of the same model in one session that started from the same random state within a minute (for example with
set.seed()before each fit) wrote to the same CmdStan output files. The first fit then silently returned the second fit’s draws, and garbage-collecting the first fit deleted the second’s files. cmdstanr builds output names from the minute, the process id and onerunif(); stanimal now gives every sampler run a uniqueoutput_basename(fromtempfile(), whichset.seed()does not affect). Laplace fits read their draws at once and keep no fit, so they were not affected. Anoutput_diroroutput_basenamepassed through...is respected.
stanimal 0.8.0
New features
-
lmm_animal()gainseigen_A, a precomputed eigendecomposition ofA(list(Q =, lambda =), e.g. fromeigen(A, symmetric = TRUE)). A caller fitting many models on the same relationship matrix, such as one model per trait subset, pays theO(N^3)decomposition once instead of once per fit. It works with every structure and parametrization, is checked againstA(reconstruction and orthonormality) before fitting, followsAwhen it is reordered to matchY, and takesblend_A. The decomposition can come from any solver, including a GPU one.
Changes in behaviour
- The animal models take the eigendecomposition of
Aas data instead of decomposingAthemselves in Stan.lmm_animal()andlmm_animal_laplace()decompose it once per fit in R; previously every chain repeated it, computing the eigenvectors and the eigenvalues separately. The model is unchanged: the eigenvalues are passed in Stan’s ascending order, and in the tests a model that decomposesAthe old way reproduces the new one draw for draw. WhereAhas repeated eigenvalues the two libraries may choose different bases for them, which can change the MCMC trajectory through rounding but not the posterior. A custommodel_filethat declaresAstill receives it. - The decomposition now runs on R’s BLAS/LAPACK. With an optimised library (OpenBLAS, MKL, Accelerate) it is several times faster than Stan’s; with R’s reference LAPACK it is about 1.5 times slower, so a single large fit can take slightly longer in wall clock (about 6% at N = 4000) while using a third of the CPU. Use an optimised BLAS for large
N, or passeigen_A. -
fit_loo()and theloo()fit methods now refuse LOO and WAIC for animal fits with missing responses; fits without response metadata warn that their likelihood terms cannot be verified. -
plot_G_ellipses()now labels each trait pair with its own genetic correlation and interval when there are four or more traits.
Bug fixes
- Animal posterior predictive replicates now use the correct relationship covariance between individuals.
-
breeding_values()retains imputation-based predictions but now computes standard errors and reliabilities conditional only on observed responses. - Univariate breeding values use the posterior mean variances, not squared posterior mean standard deviations.
- Predictive summaries now use the same observed-entry masks as the data.
-
size_shape()now reports an actionable error when the requested shape axes exceed the numerical rank of the centered shape data. -
genomic_relationship()excludes fully missing markers even with supplied frequencies andmax_missing = 1, warning when they would otherwise pass the filters. - Relabeling
fit_drawsnow also updates the trait labels of factor loadings. - Missing-data EM starts with a positive-definite covariance and errors on non-convergence or singularity; design diagnostics warn if unavailable.
stanimal 0.7.4
Bug fixes
breeding_values()now computes reliability using the individual’s prior variance,A[n,n] * G[k,k], instead of assuming unit diagonals inA.Laplace fits write the optimization mode at high precision, avoiding a Cholesky round-trip failure caused by insufficient CSV precision. They no longer suppress warnings or retry unrelated errors; a failed Laplace stage reports CmdStan output. Explicitly supplied unused model arguments warn as in the samplers.
Changes in behaviour
plot_prior_posterior()andplot_forest()can now reconstruct the ordinary factor-G prior by simulating its recorded horseshoe and factor settings. Shared-factor fits still require explicitly supplied prior draws.plot_prior_posterior()andplot_forest()now require explicit prior draws for bare draws or fits missing the metadata needed to reconstruct the prior, rather than silently assuming the default model. They validate supplied prior labels and use recorded trait names, and warn when an LKJ override differs from the fitted prior.
Documentation and tests
- Added a runnable Laplace example and tests covering model configurations, missing responses, error reporting, and a comparison with sampling.
- Clarified prior, breeding-value and data documentation. Removed committed build and check artifacts and updated the development workflow to keep them outside the checkout.
stanimal 0.7.3
Documentation
-
ratones_morphoandratones_pedigreestay, with a weak identification section explaining what they are: a long-term artificial-selection experiment that happens to carry a pedigree, in which 329 individuals from 58 sires identify a 35-traitGonly weakly, so a heritability read fromlmm_animal()on these traits depends on the prior as much as on the data. They remain the small worked example;opossumandopossum_grmare the datasets for anything about genetic covariance.
New data
-
opossumandopossum_grmship with the package: 553 Monodelphis domestica from Porto et al. (2016), measured on the same 35 cranial landmarks asratones_morpho, together with a genomic relationship matrix built from their 3,696 markers. The data are stored untransformed, as the published analysis used them. The genomic matrix is the right relationship matrix for these animals: the colony pedigree shipped with the archive puts every pair at a kinship of 0.69 to 0.93, which leaves additive variance indistinguishable from a shared colony effect.
Changes in behaviour
-
hs_slab_scalenow defaults to 1 instead of 2. The earlier explanation that the slab alone determines expected communality was incorrect: the entire horseshoe prior, factor count and decay determine its distribution. With 600 individuals and 12 traits the factor model recovers a simulatedGto a relative MSE of 0.07 at a slab of 2, while on the mice data the slab moved the posterior mean heritability through 0.10, 0.21, 0.78 and 0.80 at slabs of 0.5, 1, 2 and 4. A factor fit is therefore reproducible only if the slab is reported with it, andhs_slab_scaleshould be reported alongside the other factor prior settings.hs_global_scaleis left at 1; across 0.1 to 4 the same mouse fit moved its heritability between 0.785 and 0.790, a result specific to that example.
stanimal 0.7.2
New features
-
parametrization = "h2"now applies to the unstructured multivariate model as well as to the univariate ones. It writes the two scales as a phenotypic scale and a heritability per trait,s_G = sqrt(h2) s_Pands_E = sqrt(1-h2) s_P, and putsbeta_prioron the trait heritabilities. The default is unchanged ("variance"), and the two parameterizations agree when the data are informative, so this is the switch to reach for when there are few individuals per trait or when the heritability itself is the object of inference.
Bug fixes
- The ordinary factor model now puts the beta prior on the trait heritabilities instead of on two standard deviations. The response is standardized trait by trait, so
s_G^2 + s_E^2is the phenotypic variance and the data pin it near 1, which made the old half-normal priors ons_Gands_Ea prior on a circle: the density induced on h2 wasBeta(1/2, 1/2), with about 14% of its mass below 0.05 and 14% above 0.95 and a moderate heritability the least likely answer a priori. At a few hundred individuals the likelihood is weak enough for that to show through, and a fit could sit at either end of the range, reporting h2 near 0 or near 1 with genetic correlations to match. The model is now parameterized by a phenotypic scales_Pand a heritabilityh2, withs_G = sqrt(h2) s_Pands_E = sqrt(1 - h2) s_P, sobeta_prior(defaultc(1, 1), flat on h2) is the prior on the trait heritabilities ands_Pis the free scale.h2is still reported and still equalsdiag(G) / diag(P). The fits recordparametrization = "h2", ands_Pis a reported parameter.
stanimal 0.7.1
New features
-
lmm_animal_laplace()andlm_phen_cov_laplace()fit the same models by a Laplace approximation at the posterior mode instead of sampling them. They return posterior means and standard deviations for the covariance quantities and finish in a fraction of the time, and they deliberately return no draws: there are no chains, so there are no convergence diagnostics, and the draw-based functions refuse the result. The standard deviation of a variance or a heritability is the least reliable number they report, because a Gaussian at the mode misstates a skewed posterior.
stanimal 0.7.0
New features
- Incomplete trait records are used instead of discarded.
Ymay containNAinlmm_animal()andlm_phen_cov(): a record is kept as long as it has one observed trait, and the missing values no longer require dropping the row and losing the traits that were measured.lm_phen_cov()evaluates each missingness pattern on its observed subvector ofP, so the gaps are integrated out and cost no parameters;lmm_animal()fills them with parameters (Y_mis, reported in the draws), which is the exact marginal over the observed data and lets relatives inform a gap. A fully missing record is allowed in the animal model and an error elsewhere. -
animal_design()no longer drops rows that miss only the response; it still drops rows with missing predictors, andna.actionnow applies to those. -
size_shape()accepts a response with gaps, which it could not before: size is a mean of the traits and shape is a difference between them, so neither is defined for a row with a missing value. The response is completed first, by a maximum-likelihood multivariate normal estimated from the values that were measured (EM), and each gap becomes its conditional mean given the traits that individual has. The rest of the transformation is unchanged.$gapsreports how many entries were completed and$scores_sdthe standard deviation of each completed score, which is 0 for the individuals that were measured in full. This is a point completion, so a fit on the resulting scores treats them as data: the spread in$scores_sddoes not travel into that posterior. A row with nothing observed, and a pair of traits never measured together, are errors.pc1_variance_share(),plot_G_ellipses()and the diagnosticanimal_design()runs on its response accept gaps for the same reason. -
imputed_data()returns completed datasets, one per posterior draw: the observed entries as they are and the gaps filled on the response scale. An animal fit’s gaps are the parameters it sampled; a phenotypic fit has none, so its gaps are drawn from the normal conditional distribution given that row’s observed traits.print()reports each gap with its 95% interval. These are multiple imputations, not a single fill, andfit$draws("Y_mis")alone is not enough to reconstruct them: it is on the standardized scale and says nothing about which individual and trait each value belongs to. -
lm_phen_cov()reports pointwiselog_likfor the unstructured and factor fits, solooandwaicwork for every model in the package. It is the density on the standardized response, as in the animal models. - Univariate fits report pointwise
log_lik, so every model in the package now exposes the per-record terms thatlooandwaicneed. The h2 and variance parametrizations describe the same model and report the same density. -
fit_loo()compares fits by leave-one-out cross-validation, wrapping theloopackage on thelog_likdraws with the chain structure kept;criterion = "waic"gives WAIC, andloo(fit)dispatches to it onceloois loaded. The terms are the model block’s, one per record of the rotated response, so this compares model structures on the same data rather than leaving out one individual.loois a new Suggests. -
posterior_predictive()replicates the response from the posterior using the reportedG,EorP, and reports the observed trait means, standard deviations and pairwise correlations against the replicates, with a tail probability for each (print()) and the distributions themselves (plot()). This is the individual-level check thatfit_loo()is not. -
breeding_values()predicts each individual’s additive genetic value, which the animal models integrate out and never report. It is the conditional mean(A %x% G) V^-1 (y - X beta)at the posterior means ofG,Eandbeta, computed per individual through the eigendecomposition ofA, and returns the predictions on the response scale with an optional standard error and the reliability1 - Var(u | y) / diag(G). Being empirical Bayes, it does not propagate the uncertainty in the covariance parameters. Missing values are filled by their conditional mean first, which is exact for this linear predictor. Fits fromlmm_animal()carry the data it needs;lm_phen_cov()andlmm_animal_gibbs()do not.
Changes
-
fit_draws(),draws_mean()anddraws_quantile()now sign-align the factor loadings. A loading column is identified only up to its sign, so a chain can visit both orientations, and the average of the raw draws then cancels the factor out of a posterior mean or a heatmap. Each draw is flipped so that the trait with the largest mean absolute loading is positive, chosen once over the whole posterior.fit$draws("loadings")still returns the draws as the sampler wrote them; nothing else is reoriented, since column permutations and rotations are a different problem and are judged onGandcommunality.
stanimal 0.6.0
New features
-
lmm_animal()gainsgenetic_structure = "factor", which models the genetic covariance as a sparse factor structure on the correlation scale,G = diag(s_G) (Lambda Lambda' + Psi) diag(s_G), with regularized-horseshoe priors on the loadings (Piironen and Vehtari 2017).n_factorssets the number of factors; if it is omitted, the factor model starts from the sublinear defaultmin(K - 1, max(2, floor(sqrt(K))), 20)and reports the value.hs_global_scaleandhs_slab_scalecontrol the shrinkage, andcolumn_decayoptionally multiplies the prior standard deviation of factor columnmbycolumn_decay^(m - 1)to favour decreasing factor magnitudes. The unstructured model remains the default. Factor fits reportloadings,factor_magnitude,uniqueness,communalityands_Gin addition toG,E,P,h2and the other summaries. -
lmm_animal()gainsresidual_structure = "shared_factor"for the shared-factor modelG = Lambda diag(h2_factor) Lambda' + diag(psi_G)andE = Lambda diag(1 - h2_factor) Lambda' + diag(psi_E). The same latent factors structure both covariances, and the factor heritabilities identify how much of each factor is genetic; their beta prior is controlled by the existingbeta_priorargument. It requiresgenetic_structure = "factor"and reportsloadings,factor_magnitude,factor_heritability,genetic_uniqueness,residual_uniqueness,uniquenessandcommunality. -
lm_phen_cov()gainscovariance_structure = "factor", which replaces the unstructured phenotypic covariance with a sparse factor model on the correlation scale. It uses the same regularized-horseshoe loadings,n_factorsdefault,hs_global_scale,hs_slab_scaleandcolumn_decayas the animal factor model, and reportsloadings,factor_magnitude,uniquenessandcommunality. The factor fit estimates the residual standard deviations, soP,corrPandsigma_Pdescribe the covariance left after the fixed effects rather than the marginal covariance ofY. -
suggest_n_factors()chooses the number of factors from the data by parallel analysis (Horn 1965), comparing the eigenvalues of the residual trait correlation matrix against those of data with no shared structure. The result is an upper bound, and its attributes carry the full eigenvalue comparison.scree_eigenvalues()returns the eigenvalues behind a scree plot, andplot()draws it with the parallel-analysis cutoffs. Both residualize on the fixed effects first, so they describe the correlation the factor model fits. - The multivariate models now report pointwise
log_lik, enabling LOO, WAIC and other predictive comparisons with the fits. -
fit_draws()handles the factor outputs: factor fits returnloadingsas a trait by factor by draw array,uniquenessandcommunalityas trait by draw matrices, andfactor_heritabilityandfactor_magnitudeas factor by draw matrices. - Prior arguments are validated consistently even when the selected model does not use them, and explicitly supplying an unused prior now warns instead of being silently ignored.
-
examples/factor_model.Rdemonstrates the sparse factor model on a twelve-trait modular hierarchy, andexamples/structure_comparison.Rcompares the unstructured, diagonal, factor and shared-factor covariance structures.
Bug fixes
- Fits from the
rstanbackend now keep the trait and term names, sofit_draws()labels its arrays with the columns ofYandrename_beta()with the columns ofX. Those attributes were only attached on the cmdstanr path, which leftrstanfits with generictrait1,trait2labels. -
plot_prior_posterior()andplot_forest()compare against the prior the fit actually used instead of always drawing the unstructured one.lmm_animal()now recordslkj_prior,beta_priorandparametrizationon the fit, so an unstructured fit is compared with its own LKJ shape and a univariateparametrization = "h2"fit with its beta prior on the heritability (whichanimal_prior_draws()can now generate throughbeta_prior). A sparse factor fit has no closed-form prior to reproduce, so that combination errors and asks for an explicitpriorrather than quietly plotting the wrong comparison. - The factor phenotypic model in
lm_phen_cov()no longer pins the diagonal ofPto the marginal variance ofY. Removing the fixed effects lowers the residual variance, so the model could only fit the likelihood by inflating the correlations. It now estimates a residual scale per trait, as the unstructured model does, andsigma_Pis the residual standard deviation.
Changes
-
column_decaynow defaults to0.8instead of1in both factor models. With no decay the factor columns are exchangeable a priori, so their labels are free to swap between chains andfactor_magnitudereports largeRhatvalues on a healthy fit; the mild decay orders the columns without forcing a hierarchy.column_decay = 1restores the previous behaviour. Supplyingcolumn_decaywithout a factor model now warns instead of erroring, like the other factor priors. - Leaving
n_factorsto the fallback now warns with the number it used, instead of reporting it with a message. The fallback only sees the number of traits;suggest_n_factors()is the data-driven answer. - Chains no longer all start at the same point. The sampler used to be called with
init = 0; each chain now draws its own start from the engine default. A shared start makes chains agree by construction, soRhatcannot detect a posterior mode that no chain visited. Passinitthrough...to pin the start of a run that is hard to initialize.
stanimal 0.5.1
Name change
- The package is now called stanimal instead of stanAnimal. The functions keep their names (
lmm_animal(),animal_design(),makeA()), so onlylibrary(), the installed package name and the two cache settings change:options(stanAnimal.cache_dir = )is nowoptions(stanimal.cache_dir = ), andSTANANIMAL_CACHE_DIRis nowSTANIMAL_CACHE_DIR. Compiled models are cached per package name, so the first fit after upgrading recompiles;stanimal_clear_cache()removes the old files.
New features
-
makeA()andanimal_design()acceptGamma, a relationship matrix among founders, andgroups, an optional founder-to-group assignment. This builds theA^Gammarelationship matrix for related founders and metafounders (Legarra et al. 2015): the founder block is initialized fromGammainstead of the identity, and the tabular recursion propagates those relationships. The default remains the standard pedigree with unrelated founders. -
random_covariance()draws random covariance matrices for simulations, either from the LKJ distribution used as a prior bylmm_animal()(default), from the partial-correlation construction ofevolqg::RandomMatrix(), or from a positive size factor mixed with a sign-oriented random LKJ residual (method = "factor"). The factor method solves the factor strength (or, for weak integration, a shrinkage toward independence) to match a requested integration level, keeps PC1 positive, and redraws the residual for every matrix, so draws at a fixed integration still differ. It spans the full range without the near-singular conditioning of bending an LKJ spectrum directly. The port handles one and two traits, where the original indexing fails, and both the LKJ and factor methods avoid the nearly singular matrices the partial method often produces.trait_comparison.Ruses it for the simulated truth. -
fit_draws()extracts the draws of a fit as arrays indexed by trait, with draws last and every dimension named:G,E,P,corrG,corrE,corrPare trait by trait by draw arrays andh2,sigma_G,sigma_Eandsigma_Pare trait by draw matrices, so posterior means and correlations no longer need a helper that matchesG[i,j]variable names. It accepts the fits oflmm_animal(),lm_phen_cov()andlmm_animal_gibbs()(whoseRis returned asE),posteriordraws objects andback_transform()output, and derives quantities the fit does not report (P,corrE,corrP,sigma_G,sigma_E,sigma_P,h2). -
draws_mean()anddraws_quantile()summarise a fit or anfit_draws()object without the draw dimension, sodraws_mean(fit, "G")is the posterior mean as a trait by trait matrix anddraws_quantile(fit, "corrG")gives its interval. The examples and the README use them instead of defining their ownpost_mean()helper. -
lmm_animal()andlm_phen_cov()keep the response column names on the cmdstanr fit, sofit_draws()and the summary functions label the trait dimensions without an extra argument.
Improvements
Declare the Stan project’s R-universe as an additional repository for
cmdstanrand use it in the installation guidance.Update package metadata and DOI references for the CRAN release.
lmm_animal_gibbs()validates its arguments with the same helpers as the Stan models instead of its own inline checks:YandXthrough the shared response and design check,Athrough the shared symmetry and definiteness checks, anditer,warmupandthinthrough the shared iteration check. Its messages now name the argument the caller passed.Input checks are uniform across the package: every error names its argument in backticks and is raised without a call, so the message points at
Y,lkj_priorormafrather than at the internal function that noticed. The checks live inutils.Rand are reused, instead of each function testing its own conditions inline.lmm_animal()andlm_phen_cov()checkiter,warmup,chains,cores,cmd_stanand, forlmm_animal(),blend_Abefore fitting, so a warmup longer than the run is an error naming the argument instead of a failure inside the Stan call.Xis optional inlmm_animal(),lm_phen_cov()andlmm_animal_gibbs(). Leaving it out fits an intercept-only model: one column of ones named(Intercept), so the draws come out asbeta[(Intercept)], as they do with an explicit intercept column, andbetakeeps its trait dimension.
