Package: admvn 0.2.0

Patrick Brown

admvn: Multivariate Normal CDF and SUN Density with CppAD Derivatives

Evaluates the cumulative distribution function of the multivariate normal distribution using specialized bivariate/trivariate algorithms for dimension <= 3 and Genz quasi-Monte Carlo for higher dimensions, with gradient and Hessian with respect to the upper integration limits computed via CppAD automatic differentiation. Also provides the SUN(2,2), SUN(3,3) and SUN(4,4) densities with gradient and Hessian with respect to a block-Cholesky parameter vector, Gauss-Hermite utilities, and KL minimisation of SUN approximations on weighted quadrature.

Authors:Patrick Brown [aut, cre, cph]

admvn_0.2.0.tar.gz
admvn_0.2.0.zip(r-4.7-x86_64)admvn_0.2.0.zip(r-4.7-arm64)admvn_0.2.0.zip(r-4.6-x86_64)admvn_0.2.0.zip(r-4.6-arm64)admvn_0.2.0.zip(r-4.5-x86_64)
admvn_0.2.0.tgz(r-4.6-x86_64)admvn_0.2.0.tgz(r-4.6-arm64)admvn_0.2.0.tgz(r-4.5-x86_64)admvn_0.2.0.tgz(r-4.5-arm64)
admvn_0.2.0.tar.gz(r-4.7-arm64)admvn_0.2.0.tar.gz(r-4.7-x86_64)admvn_0.2.0.tar.gz(r-4.6-arm64)admvn_0.2.0.tar.gz(r-4.6-x86_64)
admvn_0.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
admvn/json (API)

# Install 'admvn' in R:
install.packages('admvn', 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

On CRAN:

Conda:

cppopenmp

5.26 score 1 stars 84 exports 7 dependencies

Last updated from:e1ec96a880 (on main). Checks:10 NOTE, 2 OK, 3 ERROR. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64NOTE262
linux-devel-x86_64NOTE257
source / vignettesOK775
linux-release-arm64NOTE270
linux-release-x86_64NOTE352
macos-release-arm64NOTE230
macos-release-x86_64NOTE504
macos-oldrel-arm64NOTE249
macos-oldrel-x86_64NOTE535
windows-devel-arm64ERROR365
windows-devel-x86_64NOTE408
windows-release-arm64ERROR473
windows-release-x86_64NOTE366
windows-oldrel-x86_64ERROR333
wasm-releaseOK150

Exports:dsundsun_fundsun_hsdsun_hs_fundsun22dsun22_fundsun22_hsdsun22_hs_fundsun32_hsdsun32_hs_fundsun42_hsdsun42_hs_fundsun43_hsdsun43_hs_fundsun44dsun44_fundsun44_hsdsun44_hs_fundsun52_hsdsun52_hs_funevaluate_sun22_sliceevaluate_sun32_hs_sliceevaluate_sun33_hs_sliceevaluate_sun33_sliceevaluate_sun42_hs_sliceevaluate_sun43_hs_sliceevaluate_sun44_sliceevaluate_sun52_hs_slicefit_sun22_quadfit_sun32_hs_quadfit_sun33_hs_quadfit_sun33_quadfit_sun42_hs_quadfit_sun43_hs_quadfit_sun44_quadfit_sun52_hs_quadgh_pointsmake_sun_hs_paramsmake_sun_paramsmake_sun22_hs_paramsmake_sun22_hs_start_from_ghmake_sun22_hs_start_from_normalmake_sun22_paramsmake_sun22_start_from_ghmake_sun22_start_from_normalmake_sun32_hs_paramsmake_sun32_hs_start_from_ghmake_sun32_hs_start_from_normalmake_sun33_hs_start_from_ghmake_sun33_hs_start_from_normalmake_sun33_start_from_ghmake_sun33_start_from_normalmake_sun42_hs_paramsmake_sun42_hs_start_from_ghmake_sun42_hs_start_from_normalmake_sun43_hs_paramsmake_sun43_hs_start_from_ghmake_sun43_hs_start_from_normalmake_sun44_hs_paramsmake_sun44_hs_start_from_ghmake_sun44_hs_start_from_normalmake_sun44_paramsmake_sun44_start_from_ghmake_sun44_start_from_normalmake_sun52_hs_paramsmake_sun52_hs_start_from_ghmake_sun52_hs_start_from_normalpack_genz_chpmvnpmvn_funprint_sun_kl_fitsun_mlesun22_boundssun22_hs_boundssun32_hs_boundssun33_boundssun33_hs_boundssun42_hs_boundssun43_hs_boundssun44_boundssun44_hs_boundssun52_hs_boundsweighted_covweighted_mean

Dependencies:latticeMatrixRcppRCppADRcppEigenstatmodtrustOptim

SUN(3,3) maximum likelihood with analytic gradients
Parameterization | [\operatorname | Correlation matrices | Skew loadings | sn cross-covariance quantities | Parameter order | Free vector to dp (summary) | Simulation | Build a reusable log-likelihood tape | MLE with optim() and an analytic gradient | MLE with C++ sun_mle() (trustOptim) | Comparison with sn::dsun | Parameter recovery | Gradient check at the fitted MLE

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

SUN(3,3) MLE with joint hyperspherical parameterization
Parameterization | Unit-row Cholesky from free $z$ | [B_ | t_ | Parameter order | Simulation | Build a reusable log-likelihood tape | MLE with optim() and an analytic gradient | MLE with C++ sun_mle() (trustOptim) | Comparison with sn::dsun | Parameter recovery | Gradient check at the fitted MLE

Last update: 2026-08-07
Started: 2026-08-07

SUN(3,3) KL matching with joint hyperspherical parameterization
True SUN(3,3) | Discrete target from the true law | Start far from the truth | Minimise KL | Recovery diagnostics | Parameter profiles: AD vs finite-difference gradients

Last update: 2026-08-07
Started: 2026-08-07

SUN(3,3) KL matching and recovery
True SUN(3,3) | Discrete target from the true law | Start far from the truth | Minimise KL | Recovery diagnostics | Parameter profiles: AD vs finite-difference gradients

Last update: 2026-08-06
Started: 2026-08-06

Readme and manuals

Help Manual

Help pageTopics
Multivariate normal CDF and SUN density with CppAD derivativesadmvn-package admvn
SUN(3,3) density with derivativesdsun
Create a reusable SUN(3,3) log-likelihood tapedsun_fun
SUN(3,3) density with joint hyperspherical parameterizationdsun_hs
Create a reusable SUN(3,3) hyperspherical log-likelihood tapedsun_hs_fun
SUN(2,2) density with derivativesdsun22
Create a reusable SUN(2,2) log-likelihood tapedsun22_fun
SUN(2,2) density with joint hyperspherical parameterizationdsun22_hs
Create a reusable SUN(2,2) hyperspherical likelihood tapedsun22_hs_fun
SUN(3,2) density with joint hyperspherical parameterizationdsun32_hs
Create a reusable SUN(3,2) hyperspherical likelihood tapedsun32_hs_fun
SUN(4,2) density with joint hyperspherical parameterizationdsun42_hs
Create a reusable SUN(4,2) hyperspherical likelihood tapedsun42_hs_fun
SUN(4,3) density with joint hyperspherical parameterizationdsun43_hs
Create a reusable SUN(4,3) hyperspherical likelihood tapedsun43_hs_fun
SUN(4,4) density with derivativesdsun44
Create a reusable SUN(4,4) log-likelihood tapedsun44_fun
SUN(4,4) density with joint hyperspherical parameterizationdsun44_hs
Create a reusable SUN(4,4) hyperspherical likelihood tapedsun44_hs_fun
SUN(5,2) density with joint hyperspherical parameterizationdsun52_hs
Create a reusable SUN(5,2) hyperspherical likelihood tapedsun52_hs_fun
Slice KL / cross-entropy of a SUN(2,2) vs a weighted targetevaluate_sun22_slice
Slice KL / cross-entropy of a SUN(3,2) hyperspherical fitevaluate_sun32_hs_slice
Slice KL / cross-entropy of a SUN(3,3) hyperspherical vs a weighted targetevaluate_sun33_hs_slice
Slice KL / cross-entropy of a SUN(3,3) vs a weighted targetevaluate_sun33_slice
Slice KL / cross-entropy of a SUN(4,2) hyperspherical fitevaluate_sun42_hs_slice
Slice KL / cross-entropy of a SUN(4,3) hyperspherical fitevaluate_sun43_hs_slice
Slice KL / cross-entropy of a SUN(4,4) vs a weighted targetevaluate_sun44_slice
Slice KL / cross-entropy of a SUN(5,2) hyperspherical fitevaluate_sun52_hs_slice
Fit SUN(2,2) by minimising KL on a weighted quadraturefit_sun22_quad
Fit SUN(3,2) hyperspherical by minimising KL on a weighted quadraturefit_sun32_hs_quad
Fit SUN(3,3) hyperspherical by minimising KL on a weighted quadraturefit_sun33_hs_quad
Fit SUN(3,3) by minimising KL on a weighted quadraturefit_sun33_quad
Fit SUN(4,2) hyperspherical by minimising KL on a weighted quadraturefit_sun42_hs_quad
Fit SUN(4,3) hyperspherical by minimising KL on a weighted quadraturefit_sun43_hs_quad
Fit SUN(4,4) by minimising KL on a weighted quadraturefit_sun44_quad
Fit SUN(5,2) hyperspherical by minimising KL on a weighted quadraturefit_sun52_hs_quad
Gauss-Hermite nodes and weights under a multivariate normalgh_points
Build SUN(3,3) dp from a joint hyperspherical parameter vectormake_sun_hs_params
Build SUN distribution parameters from a free parameter vectormake_sun_params
Build SUN(2,2) parameters from a joint hyperspherical vectormake_sun22_hs_params
SUN(2,2) hyperspherical start from weighted sample momentsmake_sun22_hs_start_from_gh
Map mean and covariance to a SUN(2,2) hyperspherical startmake_sun22_hs_start_from_normal
Build SUN(2,2) distribution parameters from a free parameter vectormake_sun22_params
SUN(2,2) start from weighted sample moments on a quadraturemake_sun22_start_from_gh
Map mean and covariance to a SUN(2,2) start (zero / tiny skewness)make_sun22_start_from_normal
Build SUN(3,2) parameters from a joint hyperspherical vectormake_sun32_hs_params
SUN(3,2) hyperspherical start from weighted sample momentsmake_sun32_hs_start_from_gh
Map mean and covariance to a SUN(3,2) hyperspherical startmake_sun32_hs_start_from_normal
SUN(3,3) hyperspherical start from weighted sample momentsmake_sun33_hs_start_from_gh
Map mean and covariance to a SUN(3,3) hyperspherical startmake_sun33_hs_start_from_normal
SUN(3,3) start from weighted sample moments on a quadraturemake_sun33_start_from_gh
Map mean and covariance to a SUN(3,3) start (zero / tiny skewness)make_sun33_start_from_normal
Build SUN(4,2) parameters from a joint hyperspherical vectormake_sun42_hs_params
SUN(4,2) hyperspherical start from weighted sample momentsmake_sun42_hs_start_from_gh
Map mean and covariance to a SUN(4,2) hyperspherical startmake_sun42_hs_start_from_normal
Build SUN(4,3) parameters from a joint hyperspherical vectormake_sun43_hs_params
SUN(4,3) hyperspherical start from weighted sample momentsmake_sun43_hs_start_from_gh
Map mean and covariance to a SUN(4,3) hyperspherical startmake_sun43_hs_start_from_normal
Build SUN(4,4) parameters from a joint hyperspherical vectormake_sun44_hs_params
SUN(4,4) hyperspherical start from weighted sample momentsmake_sun44_hs_start_from_gh
Map mean and covariance to a SUN(4,4) hyperspherical startmake_sun44_hs_start_from_normal
Build SUN(4,4) distribution parameters from a free parameter vectormake_sun44_params
SUN(4,4) start from weighted sample moments on a quadraturemake_sun44_start_from_gh
Map mean and covariance to a SUN(4,4) start (zero / tiny skewness)make_sun44_start_from_normal
Build SUN(5,2) parameters from a joint hyperspherical vectormake_sun52_hs_params
SUN(5,2) hyperspherical start from weighted sample momentsmake_sun52_hs_start_from_gh
Map mean and covariance to a SUN(5,2) hyperspherical startmake_sun52_hs_start_from_normal
Pack covariance into Genz chol and scalespack_genz_ch
Multivariate normal CDF with derivativespmvn
Create a reusable MVN CDF tapepmvn_fun
Print SUN KL fit diagnostics (including gradient)print_sun_kl_fit
SUN(3,3) MLE via C++ trust-region optimizationsun_mle
Default L-BFGS-B box constraints for SUN(2,2) parameterssun22_bounds
Default box constraints for SUN(2,2) hyperspherical parameterssun22_hs_bounds
Default box constraints for SUN(3,2) hyperspherical parameterssun32_hs_bounds
Default L-BFGS-B box constraints for SUN(3,3) parameterssun33_bounds
Default L-BFGS-B box constraints for SUN(3,3) hyperspherical parameterssun33_hs_bounds
Default box constraints for SUN(4,2) hyperspherical parameterssun42_hs_bounds
Default box constraints for SUN(4,3) hyperspherical parameterssun43_hs_bounds
Default L-BFGS-B box constraints for SUN(4,4) parameterssun44_bounds
Default box constraints for SUN(4,4) hyperspherical parameterssun44_hs_bounds
Default box constraints for SUN(5,2) hyperspherical parameterssun52_hs_bounds
Weighted covarianceweighted_cov
Weighted column meansweighted_mean