Version 1.2.1 of NIMBLE released
We’ve released the newest version of NIMBLE on CRAN and on our website. NIMBLE is a system for building and sharing analysis methods for statistical models, especially for hierarchical models and computationally-intensive methods (such as MCMC, Laplace approximation, and SMC).
This is a micro release that primarily addresses some packaging changes requested by CRAN. In addition, this release includes:
- A multinomial MCMC sampler,
sampler_RW_multinomial
, for random variables following a multinomial distribution. - Some enhancements to error trapping and warning messages.
- A variety of minor bug fixes.
Version 1.2.0 of NIMBLE released
We’ve released the newest version of NIMBLE on CRAN and on our website. NIMBLE is a system for building and sharing analysis methods for statistical models, especially for hierarchical models and computationally-intensive methods (such as MCMC, Laplace approximation, and SMC).
This release provides provides extensive new functionality, including:
- A Pólya-gamma sampler, `sampler_polyagamma`, for conjugate sampling of linear predictor parameters in logistic regression model specifications, including handling zero inflation and stochastic design matrices. This sampler must be added to an MCMC configuration manually.
- A new sampler, `sampler_noncentered`, which samples the mean or standard deviation of a set of random effect values in a transformed space such that the random effects are deterministically shifted or scaled given new values of their hyperparameters. For random effects written in a centered parameterization, sampling is performed as if they had been written in a noncentered parameterization, thereby enabling a variant on the Yu and Meng (2011) interweaving sampling strategy of sampling in both parameterizations.This sampler must be added to an MCMC configuration manually.
- Adaptive Gauss-Hermite quadrature (AGHQ) for integrating over continuous latent effects, as an extension of NIMBLE’s Laplace approximation functionality. We also add user-friendly R functions, `runLaplace` and `runAGHQ`, for using Laplace and AGHQ approximation for maximum likelihood estimation.
- A more flexible optimization system via `nimOptim`, with support for `nlminb` built in as well as the capability for users to provide potentially arbitrary optimization functions in R.
- Allowing the use of nimbleFunctions with setup code in models, either for user-defined functions via `<-` or for user-defined distributions via `~`. This supports holding large objects outside of model nodes for use in models.
- A completely revamped MCEM algorithm, using automatic derivatives in the maximization when possible, fixing a bug so that any parts of the model not connected to the latent states are included in MLE calculations, giving greater control and adding minor extensions to the ascent-based MCEM approach, and converting `buildMCEM` to be a nimbleFunction rather than an R function.
In addition to the new functionality above, other enhancements and bug fixes include:
- Improving the speed of MCMC and MCMC building in certain cases.
- Adding an argument to buildMCMC controlling whether to initialize values in the model.
- Providing the ability to control the number of digits printed in C++ output.
- Allowing use of a categorical MCMC sampler with user-specified dcat-like distributions.
- Warning of use of backward indexing in models.
- Improve documentation of the LKJ distribution and of advanced aspects of writing code for derivative tracking using the AD system.
- Fixing an insufficient check for conjugacy in stick-breaking specifications of Bayesian nonparametric distributions.
- Fixing compilation failures occurring on Red Hat Linux.
- Reenabling functionality for user-provided Eigen library and related updates to the autoconf configuration used in package building.
- Enhancing functionality to support model macros, which will be fully released and documented in the future.
- Removing deprecated `is.na.vec` and `is.nan.vec` functions.
- Improving some warnings and error messages.
Please see the release notes on our website for more details.
Version 1.1.0 of NIMBLE released
We’ve released the newest version of NIMBLE on CRAN and on our website. NIMBLE is a system for building and sharing analysis methods for statistical models, especially for hierarchical models and computationally-intensive methods (such as MCMC,Laplace approximation, and SMC).
This release provides new functionality as well as various bug fixes and improved error trapping, including:
- Improving our automatic differentiation (AD) system so it can be used in a wider range of models, including models with stochastic indexing, discrete latent states, and CAR distributions. Support for AD for these models means that HMC sampling and Laplace approximation can be used.
- Allowing distributions and functions (whether user-defined or built-in) that lack AD support (such as
dinterval
,dconstraint
, and truncated distributions) to be used and compiled in AD-enabled models. The added flexibility increases the range of models in which one can use AD methods (HMC or Laplace) on some parts of a model and other samplers or methods on other parts. - Adding
nimIntegrate
to the NIMBLE language, providing one-dimensional numerical integration via adaptive quadrature, equivalent to R’sintegrate
. This can, for example, be used in a user-defined function or distribution for use in model code, such as to implement certain point process or survival models that involve a one-dimensional integral. - Adding a “prior samples” MCMC sampler, which uses an existing set of numerical samples to define the prior distribution of model node(s).
- Better support of the dCRP distribution in non-standard model structures.
- Adding error trapping to prevent accidental use of C++ keywords as model variable names.
- Removing the
RW_multinomial
MCMC sampler, which was found to generate incorrect posterior results (in cases when a latent state followed a multinomial distribution) - Fixing a bug in conjugacy checking in a case of subsets of multivariate nodes.
- Fixing
is.na
andis.nan
to operate in the expected vectorized fashion. - Improving documentation of AD, nimbleHMC, and nimbleSMC in the manual.
- Updating Eigen (the C++ linear algebra library used by nimble) to version 3.4.0.
Please see the release notes on our website for more details.
nimbleHMC version 0.2.0 released, providing improved HMC performance
nimbleHMC provides Hamiltonian Monte Carlo samplers for use with NIMBLE, in particular NUTS samplers. NIMBLE’s HMC samplers can be flexibly assigned to a subset of model parameters, allowing users to consider various sampling configurations.
We’ve released version 0.2.0 of nimbleHMC, which includes a new default NUTS sampler inspired by Stan’s implementation of NUTS. It also provides an updated version of our previous NUTS sampler (which is based on the original Hoffman and Gelman paper, and is now called the ‘NUTS_classic’ sampler in NIMBLE) that fixes performance issues in version 0.1.1.
Version 1.0.1 of NIMBLE released, fixing a bug in version 1.0.0 affecting certain models
Version 1.0.0 of NIMBLE released, providing automatic differentiation, Laplace approximation, and HMC sampling
We’ve released the newest version of NIMBLE on CRAN and on our website. NIMBLE is a system for building and sharing analysis methods for statistical models, especially for hierarchical models and computationally-intensive methods (such as MCMC and SMC).
Version 1.0.0 provides substantial new functionality. This includes:
- A Laplace approximation algorithm that allows one to find the MLE for model parameters based on approximating the marginal likelihood in models with continuous random effects/latent process values.
- A Hamiltonian Monte Carlo (HMC) MCMC sampler implementing the NUTS algorithm (available in the newly-released nimbleHMC package).
- Support in NIMBLE’s algorithm programming system to obtain derivatives of functions and arbitrary calculations within models.
- A parameter transformation system allowing algorithms to work in unconstrained parameter spaces when model parameters have constrained domains.
These are documented via the R help system and a new section at the end of our User Manual. We’re excited for users to try out the new features and let us know of their experiences. In particular, given these major additions to the NIMBLE system, we anticipate the possibility of minor glitches. The best place to reach out for support is still the nimble-users list.
In addition to the new functionality above, other enhancements and bug fixes include:
- Fixing a bug (previously reported in a nimble-users message) giving incorrect results in NIMBLE’s cross-validation function (`runCrossValidate`) for all but the ‘predictive’ loss function for NIMBLE versions 0.10.0 – 0.13.2.
- Fixing a bug in conjugacy checking causing incorrect identification of conjugate relationships in models with unusual uses of subsets, supersets, and slices of multivariate normal nodes.
- Improving control of the `addSampler` method for MCMC.
- Improving the WAIC system in a few small ways.
- Enhancing error trapping and warning messages.
Please see the NEWS file in the package source for more details.
Version 0.13.1 of NIMBLE released
We’ve released the newest version of NIMBLE on CRAN and on our website. This version is purely a bug fix release that fixes a bug introduced in our new handling of predictive nodes in version 0.13.0 (released in November). If you installed version 0.13.0, please upgrade to 0.13.1.
Bug in newly-released version 0.13.0 affecting MCMC for models with predictive nodes
We recently released version 0.13.0, which has some improvements in how we handle predictive nodes in NIMBLE’s MCMC engine.
Unfortunately, we realized (thanks to a user post from a couple days ago) that there is a bug in this new approach to predictive nodes.
If you haven’t upgraded to version 0.13.0, simply wait to upgrade until we release a bug fix in 0.13.1 in the next couple weeks.
If you have upgraded to version 0.13.0 and if you have run an MCMC on a model that both (1) has predictive nodes and (2) has multivariate nodes, then the bug might affect your results. Please set:
nimbleOptions(MCMCusePredictiveDependenciesInCalculations = TRUE)
and then reconfigure/rebuild and rerun your MCMC. The option above will ensure that the MCMC behaves as it would in previous versions of NIMBLE.
Version 0.13.0 of NIMBLE released
- Thoroughly revamping handling of posterior predictive nodes in the MCMC system, in particular that MCMC samplers, by default, will now exclude predictive dependencies from internal sampler calculations. This should improve MCMC mixing for models with predictive nodes. Posterior predictive nodes are now sampled conditional on all other model nodes at the end of each MCMC iteration.
- Adding functionality to the MCMC configuration system, including a new replaceSamplers method and updates to the arguments for the addSamplers method.
- Adding an option to the WAIC system to allow additional burnin (in addition to standard MCMC burnin) before calculating online WAIC, thereby allowing inspection of initial samples without forcing them to be used for WAIC.
- Warning users of unused constants during model building.
- Fixing bugs that prevented use of variables starting with ‘logProb’ or named ‘i’ in model code.
- Fixing a bug to prevent infinite recursion in particular cases in conjugacy checking.
- Fixing a bug in simulating from dcar_normal nodes when multiple nodes passed to simulate.
We’re looking for a programmer
The NIMBLE project anticipates having some funding for a part-time programmer to implement statistical algorithms and make improvements in nimble’s core code. Examples may include building adaptive Gaussian quadrature in nimble’s programming system and expanding nimble’s hierarchical model system. Remote work is possible. This is not a formal job solicitation, but please send a CV/resume to nimble.stats@gmail.com if you are interested so we can have you on our list. Important skills will be experience with hierarchical statistical modeling algorithms, R programming, and nimble itself. Experience with C++ will be helpful but not required.