Package: adlaplace 0.5.2

adlaplace: Laplace Approximations Using Automatic Differentiation

Computes Laplace approximations for hierarchical models using automatic differentiation (CppAD) and trust-region optimization.

Authors:Patrick Brown [aut, cre, cph]

adlaplace_0.5.2.tar.gz
adlaplace_0.5.2.zip(r-4.7)adlaplace_0.5.2.zip(r-4.6)adlaplace_0.5.2.zip(r-4.5)
adlaplace_0.5.2.tgz(r-4.6-x86_64)adlaplace_0.5.2.tgz(r-4.6-arm64)adlaplace_0.5.2.tgz(r-4.5-x86_64)adlaplace_0.5.2.tgz(r-4.5-arm64)
adlaplace_0.5.2.tar.gz(r-4.7-arm64)adlaplace_0.5.2.tar.gz(r-4.7-x86_64)adlaplace_0.5.2.tar.gz(r-4.6-arm64)adlaplace_0.5.2.tar.gz(r-4.6-x86_64)
adlaplace_0.5.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION
card.svg |card.png
adlaplace/json (API)

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

Bug tracker:https://github.com/eborgnine/adlaplace/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • dat - Example GAMM simulation data
  • germany - Germany oral cavity cancer

On CRAN:

Conda:

cppopenmp

5.86 score 4 packages 44 exports 7 dependencies

Last updated from:abf0625826 (on main). Checks:13 OK. Indexed: yes.
A new build is currently in progress.

TargetResultTimeFilesSyslog
linux-devel-arm64OK214
linux-devel-x86_64OK214
source / vignettesOK401
linux-release-arm64OK252
linux-release-x86_64OK236
macos-release-arm64OK122
macos-release-x86_64OK327
macos-oldrel-arm64OK134
macos-oldrel-x86_64OK339
windows-develOK276
windows-releaseOK248
windows-oldrelOK244
wasm-releaseOK166

Exports:.type_factor_levelsad_dataad_funad_fun_ptrad_shardsadlaplaceapply_theta_logbeta_infobinomialby_groupclone_ad_fun_ptrcollect_termsdata_setupdesignelgm_matrixextra_ad_funformat_parametersfpolyfun_obj_fdfhgaussiangradhessianiidinner_optinterceptiwpjoint_log_denslaplace_half_H_invlinearlog_lik_laplacemean_mvquadmodel_datanbinomouter_fnouter_grprecisionrandom_inforef_alignrmvnldlrpolysim_fitsizestheta_infotrace_hinv_t

Dependencies:data.tablelatticeMatrixRcppRCppADRcppEigentrustOptim

GAMM Examples
check by shard | Profile derivative checks | Joint density derivative checks

Last update: 2026-07-17
Started: 2026-07-17

BYM disease mapping: Germany oral cavity cancer
Introduction | Data | Building AD shards | Combining shards | Joint log density derivatives | Inner optimization | Joint density derivative checks | Profile likelihood | Outer optimization | Spatial effects

Last update: 2026-07-17
Started: 2026-07-17

Laplace Approximations with adlaplace
Model | Simulated data | Building AD shards | Observations and hyperparameters | Random effects | Observation likelihood check | Combining shards | Joint log density derivatives | Inner optimization | likelihood | Outer optimization | Derivative checks | Joint density derivative checks | nicer interface | mean estimation

Last update: 2026-07-17
Started: 2025-11-26

Readme and manuals

Help Manual

Help pageTopics
Valid model type factor levels.type_factor_levels
Build design matrices and parameter metadata from a formulaad_data data_setup
Per-shard layout for AD density evaluationad_data-class
Build AD function with Hessian templatesad_fun ad_fun,ad_data-method ad_fun,ad_fun_ptr-method ad_fun,list-method
Build raw AD handle for one density shardad_fun_ptr
Raw AD handle (external pointer)ad_fun_ptr-class
AD function with Hessian templates attachedad_fun-class
Partition observations into AD shards by sparsity patternad_shards
Fit a hierarchical model by Laplace-approximate maximum likelihoodadlaplace
C++ backend entry pointsadlaplace_cpp fun_obj_fdfh grad hessian joint_log_dens trace_hinv_t
Methods for fitted adlaplace modelsadlaplace_fit-methods coef.adlaplace_fit confint.adlaplace_fit fitted.adlaplace_fit logLik.adlaplace_fit nobs.adlaplace_fit plot.adlaplace_fit predict.adlaplace_fit print.adlaplace_fit print.summary.adlaplace_fit summary.adlaplace_fit vcov.adlaplace_fit
Apply log transform to selected theta columnsapply_theta_log
Binomial observation termbeta_info,binomial-method binomial binomial-class design,binomial-method precision,binomial-method random_info,binomial-method theta_info,binomial-method
By-Group Classes and Functionsby_group
By-Group Classby_group-class
Combine 'ad_fun_ptr' handlesc.ad_fun_ptr
Deep copy of an 'ad_fun_ptr' handleclone_ad_fun_ptr
Parse Model Terms from Formulacollect_terms
Format Laplace estimates using parameter metadataformat_parameters
Fixed Polynomial Model Termbeta_info,fpoly-method design,fpoly-method fpoly fpoly-class precision,fpoly-method random_info,fpoly-method theta_info,fpoly-method
Example GAMM simulation datadat gamm
Gaussian observation termbeta_info,gaussian-method design,gaussian-method gaussian gaussian-class precision,gaussian-method random_info,gaussian-method theta_info,gaussian-method
Germany oral cavity cancer (Besag-York-Mollie example)germany
IID Random Effects Termbeta_info,iid-method design,iid-method iid iid-class precision,iid-method random_info,iid-method theta_info,iid-method
Inner optimization over gamma using trust-region CG (sparse)inner_opt
intercept Model Termbeta_info,intercept-method design,intercept-method intercept intercept-class precision,intercept-method random_info,intercept-method theta_info,intercept-method
Integrated Wiener Process Term Constructoriwp
Integrated Wiener Process Termbeta_info,iwp-method design,iwp-method iwp-class precision,iwp-method random_info,iwp-method theta_info,iwp-method
Extract inner inverse Cholesky factor from Laplace outputlaplace_half_H_inv
Linear Model Termbeta_info,linear-method design,linear-method linear linear-class precision,linear-method random_info,linear-method theta_info,linear-method
Log-likelihood with inner Laplace optimizationlog_lik_laplace
Posterior mean of random effects via multivariate quadraturemean_mvquad
Assemble model terms and per-shard 'ad_data' objectsmodel_data
Base Model Classmodel-class
Model Term Genericsbeta_info beta_info,model-method design design,model-method elgm_matrix extra_ad_fun extra_ad_fun,model-method model-generics precision precision,model-method random_info random_info,model-method theta_info theta_info,model-method
Negative binomial observation termbeta_info,nbinom-method design,nbinom-method nbinom nbinom-class precision,nbinom-method random_info,nbinom-method theta_info,nbinom-method
Outer objective and gradient wrappersouter_fn outer_gr outer_optim_wrappers
Simulate from a multivariate normal using LDL of the precision matrixrmvnldl
Random Polynomial Model Termbeta_info,rpoly-method design,rpoly-method precision,rpoly-method random_info,rpoly-method rpoly rpoly-class theta_info,rpoly-method
Simulate linear predictors on a new covariate gridsim_fit
Parameter-block row counts for an 'ad_data'sizes sizes,ad_data-method