Package: lmebayesCore 0.1.0

lmebayesCore: Core C++ Sampling Engine for 'lmebayes'

Core C++ engine for lmebayes: envelope-based iid samplers, two-block Gibbs mixed-model engines, and optional OpenCL acceleration. Full-featured developer backend for lmebayes and extensions. End users should use lmebayes for lmer/glmer-style mixed-model workflows.

Authors:Kjell Nygren [aut, cre], The R Core Team [ctb, cph], The R Foundation [cph], Ross Ihaka [ctb, cph], Robert Gentleman [ctb, cph], Simon Davies [ctb], Morten Welinder [ctb, cph], Martin Maechler [ctb]

lmebayesCore_0.1.0.tar.gz
lmebayesCore_0.1.0.zip(r-4.7-x86_64)lmebayesCore_0.1.0.zip(r-4.7-arm64)lmebayesCore_0.1.0.zip(r-4.6-x86_64)lmebayesCore_0.1.0.zip(r-4.6-arm64)lmebayesCore_0.1.0.zip(r-4.5-x86_64)
lmebayesCore_0.1.0.tgz(r-4.6-x86_64)lmebayesCore_0.1.0.tgz(r-4.6-arm64)lmebayesCore_0.1.0.tgz(r-4.5-x86_64)lmebayesCore_0.1.0.tgz(r-4.5-arm64)
lmebayesCore_0.1.0.tar.gz(r-4.7-arm64)lmebayesCore_0.1.0.tar.gz(r-4.7-x86_64)lmebayesCore_0.1.0.tar.gz(r-4.6-arm64)lmebayesCore_0.1.0.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
lmebayesCore/json (API)

# Install 'lmebayesCore' in R:
install.packages('lmebayesCore', repos = c('https://knygren.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/knygren/lmebayescore/issues

Uses libs:
  • openblas– Optimized BLAS
  • onetbb– Parallelism library for C++
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

openblasonetbbcpp

6.39 score 1 packages 41 exports 68 dependencies

Last updated from:28401234bc. Checks:4 ERROR, 10 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64ERROR422
linux-devel-x86_64ERROR429
source / vignettesOK658
linux-release-arm64ERROR412
linux-release-x86_64ERROR426
macos-release-arm64OK348
macos-release-x86_64OK918
macos-oldrel-arm64OK384
macos-oldrel-x86_64OK586
windows-devel-arm64OK699
windows-devel-x86_64OK578
windows-release-arm64OK622
windows-release-x86_64OK625
windows-oldrel-x86_64OK564
wasm-releaseFAIL280

Exports:beta_marginal_safe_setcertificatecheck_identifiabilitydeficiency_calibratedeficiency_spectrumdGamma_listepsilonepsilon_optimizeepsilon_starfloor_coupling_spectrumgamma_beta_tv_certificategroup_precision_floormodel_setupmvn_calibratepfamily_listplot_mean_convergenceplot_var_convergencepopulation_modeprint_groupefPrior_Setup_GLMMPrior_SetupGrouprglmerbrGLMM_regrGLMM_reg_estimated_vcovrGLMM_reg_known_vcovrlmerbrLMMindepNormalGamma_regrLMMindepNormalGamma_reg_estimated_vcovrLMMindepNormalGamma_reg_estimated_vcov_v2rLMMindepNormalGamma_reg_known_vcovrLMMindepNormalGamma_reg_known_vcov_v2rLMMNormal_regrLMMNormal_reg_estimated_vcovrLMMNormal_reg_known_vcovrLMMNormal_reg_known_vcov_iidrLMMNormal_reg_known_vcov_two_bgrNormal_reg_grouprNormalGLM_reg_grouprosenthal_tv_boundtwo_block_ratetwo_block_rate_from_pfamily_list

Dependencies:backportsbootbroomclicolorspacecowplotcpp11DerivdoBydplyrfarverforecastfracdiffgenericsggplot2glmbayesCoreglmmTMBgluegtableisobandjsonlitelabelinglatticelifecyclelme4lmtestmagrittrMASSMatrixmgcvminqamodelrnlmenloptrnmathopenclnnetnumDerivopencltoolspbkrtestpillarpkgconfigpurrrR6rbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRcppParallelRdpackreformulasrlangS7sandwichscalesstringistringrtibbletidyrtidyselecttimeDateTMBurcautf8vctrsviridisLitewithrzoo

Chapter C03: Total variation distances between multivariate normal densities
Total variation distances between multivariate normal densities | Definitions | Distance between multivariate normal densities with the same variance-covariance matrix | Distance between multivariate normal densities with the same mean vectors | Distances between multivariate normal densities | Convergence rates for two-block Gibbs samplers for multivariate normal densities | Convergence of mean vectors | Convergence of variance-covariance matrices | Convergence bounds and geometric ergodicity for the two-block Gibbs sampler | Proofs | Proof for densities with shared mean vector | Proof for densities with shared variance-covariance matrix | Proof for convergence of variance-covariance matrices | Proof for convergence of mean vectors | Proof of geometric ergodicity | Special case derivations | How the package evaluates these results | See also

Last update: 2026-08-16
Started: 2026-08-13

Chapter C05: Total Variation Bounds for Restricted Two-block Gibbs Samplers
1. Introduction | 1.1 Problem and setting | 1.2 Statement of the main results (informal) | 1.3 Relation to Rosenthal (1995) | 2. The Conditional Bound | 2.1 Two-block Gibbs sampler and the restricted kernel | 2.2 Total variation and L1 distance | 2.3 Truncation: $\pi(\cdot\mid C_d)$ vs. $\pi$ | 2.4 Theorem 1 — geometric convergence of the restricted chain | 3. The Hierarchical GLMM Model | 3.1 Model and hypotheses | 3.2 Propriety of the flat-prior posterior | 3.3 The mean map and the marginal $\gamma$-chain | 3.4 Theorem 2 — existence of a certified safe set (statement) | 4. The Refresh Measure $Q$ | 4.1 Proper population prior ($\Lambda_\gamma\succ0$) | 4.2 Flat-prior limit ($\Lambda_\gamma\downarrow0$) | 4.3 Summary: existence and nondegeneracy of $Q$ | 5. The Minorization Constant and the Certified Set | 5.1 The minorization profile $\varepsilon(\gamma)$ | 5.2 Convexity, coercivity, and compactness of $\widetilde C_d$ | 5.3 The attained constant $\varepsilon_d$ | 5.4 Flat-prior limit ($\Lambda_\gamma\downarrow0$) | 5.5 Closed form under Gaussian closure | 6. Proof of Theorem 2 | 6.1 Assembly of §4–§5 | 6.2 Lifting to the joint $(\gamma,\beta)$ chain | 7. Scope and Extensions | 7.1 Symmetric case: sharper constants | 7.2 What is and is not certified | 7.3 Open problems | Appendix — Proofs | A.1 Proofs for §3.2 (propriety of the flat-prior posterior) and §3.3 (mean map) | A.2 Proofs for §4 | A.3 Proofs for §5 | A.4 Proof of Theorem 2 | References

Last update: 2026-08-16
Started: 2026-08-13

Chapter C01: The Gaussian example -- model, data and design
The theoretical model | Group effects | Population effects | What is fixed and what has a prior | The Big Word Club data | Variables used | The model being estimated | How the population effects are indexed | The priors | See also

Last update: 2026-08-13
Started: 2026-08-13

Chapter C02: The exact Gaussian iid sampler
Prior specification | Estimating the model using the default settings | Properties of the posterior and the iid sampling procedure | Marginal distribution of the population effects | Conditional distribution of the group effects | Drawing from the posterior | Summarizing the output | Appendix: the reference lmer fit | See also

Last update: 2026-08-13
Started: 2026-08-13

Chapter C04: The two-block Gibbs sampler
Prior specification | Estimating the model using the default settings | Properties of the posterior and the two-block Gibbs procedure | Block 1: group effects given the population effects | Block 2: population effects given the group effects | One sweep and one stored draw | Where the sweep count comes from | The rate matrix for this design | From the rate to a certified sweep count | Summarizing the output | Variance convergence during the main phase | See also

Last update: 2026-08-13
Started: 2026-08-13

Chapter B00: Engine roadmap and notation
Two vignette series, two audiences | The B-series | The model | Symbol table | Internal storage | Full conditionals | Correspondence to lme4 | Model restrictions | Naming conventions in the code | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B01: The two-block Gibbs architecture
Why two blocks | One sweep | Replicate chains, not one long chain | The call stack | Route selection | Sweep-outer versus chain-outer | Inside Block 1 | Inside Block 2 | Where C++ takes over | What one sweep stores | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B02: Ergodicity and total-variation convergence
The scalar picture | The multivariate rate | Computing it without forming (P_{22}) | A worked case with a closed form | From the rate to a total-variation bound | The full-rank conditions | Level 1: each group's design must be full column rank | Level 2: the retained groups must identify (\gamma) | Beyond the Gaussian case | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B03: Calibrating m_convergence
The pipeline | What tv_tol means | Why one extra sweep | Starting points and the (D_0) term | The pilot / main cost trade-off | From a pfamily_list | When certification fails | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B04: The known-vcov Gaussian route and the exact iid sampler
Chapter B04: The known-vcov Gaussian route | Route selection | Why the route is exact | Two engines behind one route | The exact iid engine | The symmetry precondition | The Gibbs engine on an exact target | The precision matrix P | The compiled kernel | Working example | When the route does not apply | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B05: Estimated variance components (ING Block 2)
Chapter B05: Estimated variance components | Block 2 as a regression on the random effects | Two ways to update | Method A: closed-form conditional mode | Method B: rglmb(), the production path | Plug-ins and where the prior is calibrated | The truncation window | What the chain looks like | Why a pilot stage becomes necessary | Selecting components individually | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B06: The extended local rate diagnostic
Why a single (\lambda^*) stops being enough | What the engine certifies instead | The extended rate | The new blocks | The residuals only make it worse | Using it | Reading the output | Two checks worth running | Scanning over draws | The marginal route | Theorem or heuristic: the honest table | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B07: Per-group measurement dispersion
The model, and what dispformula selects | Calibrating (\sigma^2_j): why the within-group RSS is the wrong target | The marginal sum of squares | The Gamma parameters | rate versus rate_gamma | Folding in hyperparameter uncertainty | The truncation window | dGamma_list() | What Block 1 does with it | Effect on the rate | Caveats | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B08: Design, identifiability and rank conditions
What model_setup() returns | Level 1: within-group rank | What failure means, and what it does not | The estimability check | Level 2: across-group rank | Why this one is fatal | Fixed-effect grammar | Reading the print output | A worked failure | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B09: Row-block engines
The engines | The partition object | Block 1 of the mixed-model sampler | lmbBlock() and glmbBlock() are not these engines | Per-block prior calibration | Identifiability, without a second level | Who owns what | See also

Last update: 2026-08-10
Started: 2026-08-10

Chapter B10: Sweep history and convergence plots
Why the ensemble view is the right one | The object | Which engines populate it | Reading the two plots | plot_mean_convergence() | plot_var_convergence() | Multiple chains and n_chains | Using the history programmatically | Interpreting a pilot history | See also

Last update: 2026-08-10
Started: 2026-08-10

Readme and manuals

Help Manual

Help pageTopics
lmebayesCore: Core C++ Sampling Engine for lmebayeslmebayesCore-package lmebayesCore
Marginal-mode beta safe set for Rosenthal / TV certificatesbeta_marginal_safe_set
Restricted two-block Gibbs minorization certificate (Chapter C05).certificate
Check identifiability and estimability of a single-factor mixed-model designcheck_identifiability
Calibrate reference radius r(delta) and deficiency d = r^2/2.deficiency_calibrate
Coupling eigenvalue spectrum at the population mode.deficiency_spectrum
Build a named list of dGamma measurement-dispersion priorsdGamma_list dGamma_list.Prior_Setup_GLMM print.dGamma_list
Restricted-chain Doeblin multiplier epsilon from spectrum-calibrated sizing.epsilon
Numerical epsilon(gamma*) from the minorization profile.epsilon_optimize
Mode profile epsilon(gamma*) for the restricted Gibbs certificate.epsilon_star
Floor coupling eigenvalue spectrum on a beta safe set.floor_coupling_spectrum
Sharpest displayed gamma-beta total-variation certificate.gamma_beta_tv_certificate
Certified group-level data precision lower boundsgroup_precision_floor
Model setup for generalized linear mixed modelsmodel_setup print.model_setup
Legacy MVN-calibrated reference radius (equal-weight chi-square shortcut).mvn_calibrate
Build a named list of pfamily objectspfamily_list pfamily_list.Prior_SetupGroup pfamily_list.Prior_Setup_GLMM print.pfamily_list
Combined mean-convergence plot for Block~2 fixed effects (Claim 1)plot_mean_convergence plot_mean_convergence.default plot_mean_convergence.rglmerb plot_mean_convergence.rGLMM_reg plot_mean_convergence.rlmerb plot_mean_convergence.rLMMindepNormalGamma_reg plot_mean_convergence.rLMMNormal_reg
Combined variance-convergence plot for Block~2 fixed effects (Claim 3)plot_var_convergence plot_var_convergence.default plot_var_convergence.rglmerb plot_var_convergence.rGLMM_reg plot_var_convergence.rlmerb plot_var_convergence.rLMMindepNormalGamma_reg plot_var_convergence.rLMMNormal_reg
EM fixed point for the C05 population mode gamma*.population_mode
Print simulated group coefficients from an LMM/GLMM resultprint_groupef print_groupef.default print_groupef.rglmerb print_groupef.rGLMM_reg print_groupef.rlmerb print_groupef.rLMMindepNormalGamma_reg print_groupef.rLMMNormal_reg
Prior setup for generalized linear mixed modelsprint.Prior_Setup_GLMM Prior_Setup_GLMM
Prior setup for row-block regressionsprint.Prior_SetupGroup Prior_SetupGroup
The Bayesian Generalized Linear Mixed-Effects Model Distributionrglmerb
Simulation Functions for Generalized Linear Mixed Modelsprint.rGLMM_reg rGLMM_reg rGLMM_reg_estimated_vcov rGLMM_reg_known_vcov
The Bayesian Linear Mixed-Effects Model Distributionrlmerb
Simulation Functions for Linear Mixed Modelsprint.rLMMindepNormalGamma_reg print.rLMMNormal_reg rLMMindepNormalGamma_reg rLMMindepNormalGamma_reg_estimated_vcov rLMMindepNormalGamma_reg_estimated_vcov_v2 rLMMindepNormalGamma_reg_known_vcov rLMMindepNormalGamma_reg_known_vcov_v2 rLMMNormal_reg rLMMNormal_reg_estimated_vcov rLMMNormal_reg_known_vcov rLMMNormal_reg_known_vcov_iid rLMMNormal_reg_known_vcov_two_bg rLMM_reg
Rosenthal total-variation bound for the beta-restricted gamma chain.rosenthal_tv_bound
Conditionally independent block simulation (Gibbs / product likelihood)rNormalGLM_reg_group rNormal_reg_group simfuncs_group
Summarizing Bayesian mixed model distribution functionsprint.summary.rlmerb summary.rglmerb summary.rlmerb
Two-block Gibbs sampler convergence rate (Remark 8 eigenvalues)print.two_block_rate print.two_block_rate_ing two_block_rate two_block_rate_from_pfamily_list two_block_rate_ing