bgw: Bunch-Gay-Welsch Statistical Estimation

Performs statistical estimation and inference-related computations by accessing and executing modified versions of 'Fortran' subroutines originally published in the Association for Computing Machinery (ACM) journal Transactions on Mathematical Software (TOMS) by Bunch, Gay and Welsch (1993) <doi:10.1145/151271.151279>. The acronym 'BGW' (from the authors' last names) will be used when making reference to technical content (e.g., algorithm, methodology) that originally appeared in ACM TOMS. A key feature of BGW is that it exploits the special structure of statistical estimation problems within a trust-region-based optimization approach to produce an estimation algorithm that is much more effective than the usual practice of using optimization methods and codes originally developed for general optimization. The 'bgw' package bundles 'R' wrapper (and related) functions with modified 'Fortran' source code so that it can be compiled and linked in the 'R' environment for fast execution. This version implements a function ('bgw_mle.R') that performs maximum likelihood estimation (MLE) for a user-provided model object that computes probabilities (a.k.a. probability densities). The motivation for producing this initial version is to provide fast, efficient, and reliable MLE for discrete choice models that can be called from the 'Apollo' choice modelling 'R' package: see <>. However, estimation can also be performed in a stand-alone fashion without using 'Apollo' (as shown in simple examples). After this initial version is available on CRAN, an updated version of 'Apollo' (0.2.9) will be made available that automatically loads 'bgw'. Additional development can then occur, including more detailed examples in 'bgw' that refer to 'Apollo.' Note also that BGW capabilities are not limited to MLE, and future extension to other estimators (e.g., nonlinear least squares, generalized method of moments, etc.) is possible. The 'Fortran' code included in 'bgw' was modified by one of the original BGW authors (Bunch) under his rights as confirmed by direct consultation with the ACM Intellectual Property and Rights Manager. See <>. The main requirement is clear citation of the original publication (see above).

Version: 0.1.1
Depends: R (≥ 4.0.0)
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
Published: 2023-04-06
Author: David S. Bunch ORCID iD [aut, cre], David M. Gay [ctb], Roy E. Welsch [ctb], Stephane Hess [ctb], David Palma [ctb]
Maintainer: David S. Bunch <dsbunch at>
License: GPL-3
NeedsCompilation: yes
Citation: bgw citation info
Materials: NEWS
CRAN checks: bgw results


Reference manual: bgw.pdf
Vignettes: bgw-vignette


Package source: bgw_0.1.1.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release (arm64): bgw_0.1.1.tgz, r-oldrel (arm64): bgw_0.1.1.tgz, r-release (x86_64): bgw_0.1.1.tgz, r-oldrel (x86_64): bgw_0.1.1.tgz
Old sources: bgw archive

Reverse dependencies:

Reverse imports: apollo


Please use the canonical form to link to this page.