Recent Releases of nimble
nimble - v1.3.0
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).
Version 1.3.0 provides some new and improved functionality, plus some bug fixes and improved error trapping.
The new and improved functionality includes:
- A new multivariate MCMC sampler, the Barker proposal sampler (
sampler_barker). We encourage users to try this sampler in place of the block MetropolisRW_blocksampler and let us know how well it works. The Barker sampler uses gradient information and may improve adaptation behavior, including better mixing when parameters are on different scales or the initial proposal scale is too large. - An improved Laplace/AGHQ implementation that includes use of the
nlminboptimizer for both inner and outer optimization (for better optimization performance), improved messaging and output naming, returning the log-likelihood and degrees of freedom for model selection calculations, and unified control of optimization method and other controls at either the build stage or through theupdateSettingsmethod. - The addition of the BOBYQA optimization method through
nimOptim, registered vianimOptimMethod.
In addition to the new and improved functionality above, other bug fixes, improved error trapping, and enhancements include:
- Preventing the use of nimbleFunction method names and nimbleFunction names that conflict with names in the nimble language (DSL).
- More carefully checking for and warning of cases of NaN and non-finite log probability values in various samplers that in some cases may indicate invalid MCMC sampling.
- More carefully handling of NaN and non-finite log probability values in the CRP sampler.
- Error trapping cases of dynamic indices producing a non-scalar result in AD-enabled models and provide a suggested work-around.
- Error trapping use of a non-existent nimbleList.
- Preventing use of a single seed when running multiple chains via runMCMC.
- Improving messaging related to lack of derivative support for functions.
- Adding information about model macros to the manual.
- Fixing bug in caching values in the CRP sampler when maximum number of clusters is exceeded, which would have caused incorrect sampling (albeit with the user having been warned that they should increase the maximum number of clusters).
- Fixing an issue preventing use of nimbleList elements in nimCat.
- Preventing an adaptation interval of one for various block samplers for which an interval of one leads to an error.
- Allowing runLaplace to use an uncompiled Laplace object.
- C++
Published by paciorek about 1 year ago
nimble - v1.2.1
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, samplerRWmultinomial, for random variables following a multinomial distribution.
- Some enhancements to error trapping and warning messages.
- A variety of minor bug fixes.
- C++
Published by paciorek almost 2 years ago
nimble - v1.2.0
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).
Version 1.2.0 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. - 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. - A completely revamped MCEM algorithm, 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, using automatic derivatives in the maximization when possible, and converting
buildMCEMto be a nimbleFunction rather than an R function. - Adaptive Gauss-Hermite quadrature (AGHQ) for integrating over latent effects, as an extension of NIMBLE's Laplace approximation functionality. Also adds user-friendly R functions,
runLaplaceandrunAGHQ, for using Laplace and AGHQ approximation for maximum likelihood estimation. - A more flexible optimization system via
nimOptim, with support fornlminbbuilt 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.
In addition to the new functionality above, other enhancements and bug fixes include:
- Erroring out if the
RW_blocksampler is assigned to any discrete nodes. - Improving the speed of MCMC building in certain cases with many simple samplers by using
inheritsrather thanis. - Adding an argument to
buildMCMCcontrolling whether to initialize values in the model. - Improving the efficiency of setting up derivative information for models with multivariate nodes with many elements.
- Providing ability to control number of digits printed in C++ output.
- Allowing use of categorical MCMC sampler with user-specified
dcat-like distributions. - Warning of use of backward indexing in nimble models.
- Improve documentation of LKJ distribution and derivative tracking in the AD system.
- Fixing some internals related to memory handling in compiled code to avoid intermittent errors and crashes occurring in testing.
- Fixing a harmless typo causing partial name matching in R.
- Fixing an insufficient check for conjugacy in stickbreaking specifications.
- Removing spurious warning when
returnTypeischaracter()in a nimbleFunction. - Fixing incorrect error message when
getParamused with non-existent node. - Fixing compilation failures occurring on Red Hat Linux.
- Reenabling functionality for user-provided Eigen library and related updates to autoconf configuration.
- Enhancing functionality to support model macros.
- Removing deprecated
is.na.vecandis.nan.vec. - Removing deprecated dummy functions for
compareMCMCsfunctions.
- C++
Published by paciorek about 2 years ago
nimble - v1.1.0
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).
Version 1.1.0 provides new functionality and a variety of bug fixes.
- Enhancing our automatic differentiation (AD) system to enhance use of AD (and therefore HMC sampling) in models, including use of stochastic indexing and CAR models, as well as 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. - Adding
nimIntegrateto the NIMBLE language, providing one-dimensional numerical integration via adaptive quadrature, equivalent to R'sintegrate. - Adding a "prior samples" MCMC sampler, which uses an existing set of numerical samples to define the prior distribution of model node(s).
- Better handling of CRP models under non-standard settings.
- Cleanly error trapping use of C++ keywords as model variable names.
- Removing the
RW_multinomialMCMC sampler, which was found to generate incorrect posterior results. - Fixing a bug in conjugacy checking in a case of subsets of multivariate nodes.
- Fixing
is.naandis.nanto operate in the expected vectorized fashion. - Improving documentation of AD,
nimbleHMC, andnimbleSMCin the manual. - Updating to Eigen version 3.4.0.
- C++
Published by paciorek over 2 years ago
nimble - v1.0.1
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.1 follows shortly after 1.0.0 and fixes a bug introduced in version 1.0.0 causing data to be set incorrectly in certain models and likely causing incorrect results from algorithms such as MCMC. The affected models are ones with autoregressive structure directly on data nodes and with a variable containing both data and elements appearing only on the right-hand side of model declarations (such as is often the case for capture-recapture models).
- C++
Published by paciorek almost 3 years ago
nimble - v1.0.0
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
nimbleHMCpackage). - 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
addSamplermethod for MCMC. - Improving the WAIC system in a few small ways.
- Enhancing error trapping and warning messages.
- C++
Published by paciorek about 3 years ago
nimble - v0.13.2
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 0.13.2 exists solely to address some developer-level issues as required by CRAN and is identical to 0.13.1 from the user perspective.
- C++
Published by paciorek about 3 years ago
nimble - v0.13.1
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 0.13.1 follows shortly after 0.13.0 and fixes a bug introduced in our new handling of predictive nodes in MCMC in version 0.13.0. The bug could affect MCMC results when using version 0.13.0 in models that both (1) have predictive nodes and (2) have multivariate nodes.
- C++
Published by paciorek over 3 years ago
nimble - v0.13.0
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 0.13.0 provides a variety of new functionality and bug fixes, including:
- 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
replaceSamplersmethod and argumentsdefaultandnodesfor theaddSamplersmethod. - 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_normalnodes when multiple nodes passed to simulate.
- C++
Published by paciorek over 3 years ago
nimble - v0.12.2
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 0.12.2 is a bug fix release. In particular, this release fixes a bug in our Bayesian nonparametric distribution (BNP) functionality that gives incorrect MCMC results when using the dCRP distribution when the parameters of the mixture components (i.e., the clusters) have hyperparameters (i.e., the base measure parameters) that are unknown and sampled during the MCMC. Here is an example basic model structure that is affected by the bug:
k[1:n] ~ dCRP(alpha, n)
for(i in 1:n) {
y[i] ~ dnorm(mu[k[i]], 1)
mu[i] ~ dnorm(mu0, 1) ## mixture component parameters with hyperparameter
}
mu0 ~ dnorm(0, 1) ## unknown cluster hyperparameter
(There is no problem without the hyperparameter layer – i.e., if mu0 is a fixed value – which is the situation in many models.) We strongly encourage users using models with this structure to rerun their analyses.
Other changes in this release include:
- Fixing an issue with reversible jump variable selection under a similar situation to the BNP issue discussed above (in particular where there are unknown hyperparameters of the regression coefficients being considered, which would likely be an unusual use case).
- Fixing a bug preventing setup of conjugate samplers for dwishart or dinvwishart nodes when using dynamic indexing.
- Fixing a bug preventing use of truncation bounds specified via
dataorconstants. - Fixing a bug preventing MCMC sampling with the LKJ prior for 2×2 matrices.
- Fixing a bug in
runCrossValidateaffecting extraction of multivariate nodes. - Fixing a bug producing incorrect subset assignment into logical vectors in nimbleFunction code.
- Fixing a bug preventing use of
nimbleExternalCallwith a constant expression. - Fixing a bug preventing use of recursion in nimbleFunctions without setup code.
- Fixing handling
nimSeqdefaultbyvalue. - Fixing access to member data more than two dimensions in a nested nimbleFunction.
- C++
Published by paciorek over 4 years ago
nimble - v0.12.1
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 0.12.1 follows shortly after 0.12.0 and fixes a bug introduced in conjugacy processing in version 0.11.0 that causes incorrect MCMC sampling only in specific cases. The impacted cases have terms of the form "a[i] + x[i] * beta" (or more simply "x[i] * beta" or "a[i] + beta"), with beta subject to conjugate sampling and either (i) 'x' provided via NIMBLE's constants argument and x[1] == 1 or (ii) 'a' provided via NIMBLE's constants argument and a[1] == 0.
- C++
Published by paciorek over 4 years ago
nimble - v0.12.0
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 0.12.0 provides a variety of new functionality, bug fixes, and improved error trapping, including:
- completely revamping WAIC such that (1) by default WAIC is calculated in an online fashion without the need for any particular monitors, (2) either conditional or marginal (integrating over latent variables) WAIC can be calculated and data nodes can be grouped into joint likelihood terms, and (3) there is a new calculateWAIC() function that can compute (conditional) WAIC on a user-provided samples either in an MCMC object or a matrix;
- adding the LKJ distribution, useful for prior distributions for correlation matrices, with default Metropolis-Hastings samplers executing on an unconstrained trasnformed parameter space;
- fixing a bug in MCMC sampling of the dcarproper distribution that results in incorrect MCMC results when the mean of the dcarproper distribution is not the same for all elements of the node assigned the distribution;
- fixing the isData() function to return TRUE whenever any elements of a multivariate data node are flagged as data;
- correctly error trapping cases where a Bayesian nonparametric model has a differing number of dependent stochastic nodes (e.g., observations) or dependent deterministic nodes per group of elements clustered jointly, thereby preventing incorrect MCMC sampling in such cases, which were not previously detected; and
- improving the formatting of standard logging messages produced by nimbleModel() and compileNimble().
- C++
Published by paciorek over 4 years ago
nimble - v0.11.1
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 0.11.1 is primarily a bug fix release that fixes a bug that was introduced in Version 0.11.0 (which was released on April 17, 2021) that affected MCMC sampling in MCMCs using the “posteriorpredictivebranch” sampler introduced in version 0.11.0. This sampler would be listed by name when the MCMC configuration object is created and would be assigned to any set of multiple nodes that (as a group of nodes) have no data dependencies and are therefore sampled as a group from their predictive distributions.
- C++
Published by paciorek about 5 years ago
nimble - v0.11.0
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 0.11.0 provides a variety of new functionality (posteriorpredictivebranch MCMC sampler, getParents() method, improved conjugate sampling efficiency), improved error trapping, and bug fixes, in particular fixing a bug giving incorrect node names and potentially affecting algorithm behavior for models with more than 100,000 elements in a vector node or any dimension of a multi-dimensional node.
- C++
Published by paciorek about 5 years ago
nimble - v0.10.1
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 0.10.1 is primarily a bug fix release. It fixes a bug in retrieving parameter values from distributions that was introduced in version 0.10.0. The bug can cause incorrect behavior of conjugate MCMC samplers under certain model structures (such as particular state-space models), so we strongly encourage users to upgrade to 0.10.1. In addition, version 0.10.1 restricts use of WAIC to the conditional version of WAIC (conditioning on all parameters directly involved in the likelihood). Previous versions of nimble gave incorrect results when not conditioning on all parameters directly involved in the likelihood (i.e., when not monitoring all such parameters). In a future version of nimble we plan to make a number of improvements to WAIC, including allowing use of marginal versions of WAIC, where the WAIC calculation integrates over random effects.
- C++
Published by paciorek over 5 years ago
nimble - v0.10.0
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 0.10.0 greatly extends NIMBLE's CRP-based BNP functionality by allowing multiple observations to be grouped together, improves the efficiency of various model and algorithm building steps, moves the sequential Monte Carlo (SMC; aka particle filtering) algorithms to the new nimbleSMC package, and fixes a bug that produced incorrect results from runCrossValidate. In addition there are a variety of other improvements and bug fixes. Please see the inst/NEWS file.
- C++
Published by paciorek over 5 years ago
nimble - v0.9.1
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 0.9.1 is primarily a bug fix release that fixes use of NIMBLE in R 4.0 on Windows but also provides some minor improvements in functionality.
- C++
Published by paciorek about 6 years ago
nimble - v0.9.0
NIMBLE is an R package for hierarchical statistical modeling (aka graphical modeling). It enables writing general models along with methods such as Markov chain Monte Carlo (MCMC), particle filtering (aka sequential Monte Carlo), and other general methods.
This release adds a new SMC algorithm, fixes some bugs in existing SMC algorithms, improves the speed of MCMC configuration, and fixes a variety of bugs.
- C++
Published by paciorek over 6 years ago
nimble - v0.7.1
NIMBLE is an R package for hierarchical statistical modeling (aka graphical modeling). It enables writing general models along with methods such as Markov chain Monte Carlo (MCMC), particle filtering (aka sequential Monte Carlo), and other general methods.
This release is primarily a maintenance release focused on bug fixes, including fixing an error in MCMC sampling for the dCRP Bayesian nonparametric distribution and fixing a stack overflow issue.
- C++
Published by paciorek about 7 years ago
nimble - v0.6.13
NIMBLE is an R package for hierarchical statistical modeling (aka graphical modeling). It enables writing general models along with methods such as Markov chain Monte Carlo (MCMC), particle filtering (aka sequential Monte Carlo), and other general methods.
This release includes additional efficiency and functionality for Bayesian nonparametric mixture modeling using Dirichlet process mixtures, additional MCMC samplers and functionality, and several bug fixes.
- C++
Published by paciorek about 7 years ago
nimble - v0.6-12
NIMBLE is an R package for hierarchical statistical modeling (aka graphical modeling). It enables writing general models along with methods such as Markov chain Monte Carlo (MCMC), particle filtering (aka sequential Monte Carlo), and other general methods.
This release is a maintenance release focused on bug fixes, including fixing a numerical bug in the bootstrap filter and fixing an overly aggressive check for random arrays in model building.
- C++
Published by paciorek almost 8 years ago
nimble - v0.6-11
NIMBLE is an R package for hierarchical statistical modeling (aka graphical modeling). It enables writing general models along with methods such as Markov chain Monte Carlo (MCMC), particle filtering (aka sequential Monte Carlo), and other general methods.
This release includes support for Bayesian nonparametric mixture modeling using Dirichlet process mixtures, more flexibility in NIMBLE's particle filtering algorithms, and improved MCMC functionality.
- C++
Published by paciorek almost 8 years ago