Up to [cvs.NetBSD.org] / pkgsrc / math / R-nimble
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
(math/R-nimble) Updated 1.3.0 to 1.4.2, Fix build against R-4.6.0 # CHANGES IN VERSION 1.4.2 (March 2026) ## USER LEVEL CHANGES - Improve efficiency of `findSamplersOnNodes`, which is used in finding samplers assigned to node(s) (PR #1614; thanks to 'hoxo-m'). ## DEVELOPER LEVEL CHANGES - Switch to using `R_getVar` and `R_getVarEx` in place of `Rf_findVar` and `Rf_findVarInFrame` in C++ code at request of CRAN (PR #1616). # CHANGES IN VERSION 1.4.1 (February 2026) ## USER LEVEL CHANGES - Add a new sampler to sample portions of a multivariate normal node when some elements are observed (i.e., data) and some elements are unknown. This sampler uses the exact conditional normal to sample from the posterior predictive distribution when the unknown elements have no dependent data nodes (PR #1612). - Add ability to change the MCMC thinning interval when continuing an MCMC (PR #1609). ## BUG FIXES - Fix a bug in the conjugacy size processing system when dependent nodes (of the target conjugate node) themselves have multivariate parameters with a different size from the dependent node itself (PR #1605). ## DEVELOPER LEVEL CHANGES - Turn off an old work-around that prevented RStudio from hanging but which modified the global environment and no longer appears to be necessary (PR #1606). # CHANGES IN VERSION 1.4.0 (December 2025) ## USER LEVEL CHANGES - Move Laplace/AGHQ approximation to new `nimbleQuad` package, which also has new INLA-like deterministic nested posterior approximation. - Add system for computing and storing "derived quantities" during MCMC execution, for recording additional quantities of interest at every saved MCMC iteration (i.e., following thinning interval, or some other user-chosen interval). Derived quantities available provided by NIMBLE include means, variances, model log-densities, and predictive nodes. Users can also define their own derived quantities. - Provide matrix exponential functionality via `expm` and `expAv`. - Allow users to provide multiple code chunks to `nimbleCode` for greater flexibility in composing models. - Greatly improve efficiency and memory use of AD system (PR #1574). - Remove some references to "BUGS" when referring to models. - Allow users to turn off `model$checkBasics` via a new option. - Improve MCEM non-convergence error message (Issue #1535). - Better handle inconsistencies between `inits` and `dimensions` (PR #1571). - Make minor improvements to Pólya-gamma sampler to check for infinities in design matrix, fix where `inflationNodes` defined, and avoid design matrix initialization when passed by user (PR #1569). - Add message when `addSampler` avoids assigning sampler for data nodes (PR #1580). - Add additional checks for correct usage of derivative calls (PR #1566). - Improve messaging when `checkLogProb` warning invoked (PR #1559). - Error trap use of negation in indexing in nimbleFunction code (PR #1561). - Error trap disallowed use of parentheses in indexing in model code (PR #1556). - Avoid parameter transformation system causing an error with user-defined multivariate distributions (PR #1532). - Error trap use of `x <- c()` (empty concatenate to initialize a variable) in nimbleFunction code (PR #1560). - Added support for conjugate MCMC sampling of `tau` parameter of the intrinsic CAR (`dcar_normal`) distribution (PR #1596). - Error trap if `inits` provided to `nimbleModel()` as a function (Issue #1598). ## BUG FIXES - Fix bug in `makeModelDerivsInfo` for multiply-split LHSinferred nodes (PR #1594). - Fix bug in `getConditionallyIndependentSets` arising with corner case involving particular order of `nodes` (PR #1576). - Fix bug in initial types in `nimOptimDefaultControl` (PR #1581). - Fix `rCRP` to return zero length if `size` is zero. - Fix dimension issue in `sampleDPmeasure` (PR #1572). - Fix compilation issue with min/max under some circumstances (PR #1557). - Fix inconsistency in recycling rule for `rmnorm` (PR #1586). - In `buildMCEM`, fix use of `pStart`, when provided by user, make thinning conform to other MCMC uses, add new error trapping, and clean up other details (PR #1601). ## DEVELOPER LEVEL CHANGES - Provide AD-optimized `dmnormAD`. - Greatly improve efficiency of `makeModelDerivsInfo_impl` by working with nodes rather than scalarComponents as much as possible (PR #1590). - Greatly improve efficiency in `setData` by omitting RHS-only elements (Issue #1589). - Omit unneeded marginalization nodes in `setupMargNodes` and rework messaging for setupMargNodes warnings (Issue #1582). - Synthesize some Laplace-related tools useful more generally in `normTooling.R` and `setupMargNodes.R`. - Document `reset` arg to `nimDerivs` (Issue #1555). - Add derivative building for `transform` method of parameterTransform (PR #1565). - Fix scoping for `nimbleMCMC` (PR #1554). - Trap error in `buildMacro` when `use3pieces=TRUE` but the provided code is not an assignment (PR #1529). - Improve efficiency of checking for nimbleFunction name conflicts (PR #1553). - Set `replaceSamplers` to do lookup in parent frame (PR #1539). - Check for dollar sign in `cc_expandDetermNodesInExpr` (PR #1534). - Generalize system of dynamically generating conjugate MCMC samplers, to allow for multivariate parameters of dependent distributions to have distinct sizes from the dependent node itself (PR #1596). - Make MCEM append new samples when increasing sample size using the ascent-based method, rather than starting a new sample (PR #1601).
(math/R-nimble) Updated 1.2.1 to 1.3.0 # CHANGES IN VERSION 1.3.0 (December 2024) ## USER LEVEL CHANGES - Provide the Barker proposal sampler as an alternative to the `RW_block` (block Metropolis) sampler. The Barker sampler uses gradient information and may improve adaptation behavior, including better mixing when parameter are on different scales or the initial proposal scale is too large (PR #1492). - Improve Laplace/AGHQ implementation in various ways, including use of nlminb 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 the `updateSettings` method (PR #1496). - Add BOBYQA as an optimization method available through `nimOptim`, registered via `nimOptimMethod` (PR #1496). - Prevent use of nimbleFunction method names and nimbleFunction names that conflict with names in the nimble language (DSL) (PRs #1517 and #1519). - More carefully check for and warn of cases of NaN and non-finite log probability values in various samplers that in some cases may indicate invalid MCMC sampling (PR #1512). - More carefully handle NaN and non-finite log probability values in the CRP sampler, in particular error out if all values are minus infinity and warning if multiple values are infinity (PR #1509). - Error trap cases of dynamic indices producing a non-scalar result in AD-enabled models, and provide a suggested work-around (PR #1515). - Error trap use of non-existent nimbleList (PR #1518). - Prevent use of a single seed when running multiple chains via `runMCMC` (PR #1494). - Improve messaging related to lack of derivative support for functions (PR #1502). - Add information about model macros to the manual (PR #1499). - Add an argument to `deregisterDistributions` to turn off warning that a distribution being deregistered does not exist. ## BUG FIXES - Fix bug in caching values in `sampler_CRP` 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) (PR #1513). - Fix issue preventing use of nimbleList elements in `nimCat` (PR #1518). - Prevent adaptation interval of one for various block samplers for which an interval of one leads to an error. - Allow `runLaplace` to use an uncompiled Laplace object (PR #1496). ## DEVELOPER LEVEL CHANGES - Improve and provide additional infrastructure for model macros (PR #1502). - Add new model method, `MixedDataNodeNames` to retrieve node names which are partially observed (whose elements are partially but not entirely data) (PR #1489). - Turn off the use of `--preclean` during C++ compilation when `nimbleExternalCall` is invoked to avoid removing .o files that might have been created by `Rcpp` (PR #1520).
(math/R-nimble) Updated 1.0.1 to 1.2 1
# CHANGES IN VERSION 1.2.1 (July 2024)
## USER LEVEL CHANGES
- Provide a multinomial MCMC sampler for random variables following
a multinomial distribution. This replaces a sampler in earlier versions of
NIMBLE that had a bug and was removed as of version 1.1.0 (PR #1478).
- More robustly handle dataframe inputs to `inits` (PR #1481).
- Enhance compile-time and run-time error-trapping of size mismatches for
assignment operator (#1459).
## BUG FIXES
- Fix minor issue affecting `buildAGHQ` when `updateSettings` is used
before compilation with inputs that change `constant_init_par` (PR #1480).
- Fix output of `as.list.CmodelValues` for 1-row case (PR #1482).
- Improve documentation for AD related to preventing derivative tracking.
## DEVELOPER LEVEL CHANGES
- Turn off spurious `getParam` warning affecting use of user-defined
distributions with more than two dimensions (PR #1481).
- Rework checking for `configureRJ` (PR #1475).
- Remove template arguments from `NimArr` constructors/destructors for C++20,
fixing based on CRAN request (PR #1479).
- Only import `igraph` functions actually used (PR #1482).
# CHANGES IN VERSION 1.2.0 (June 2024)
## USER LEVEL CHANGES
- Add 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(PR #1439).
- Add 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 (PR #1437) .
- Completely revamp 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
`buildMCEM` to be a nimbleFunction rather than an R function (PR #1428).
- Provide 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, `runLaplace` and `runAGHQ`, for using
Laplace and AGHQ approximation for maximum likelihood estimation (PR #1455).
- Provide 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 (PR #1455).
- Allow 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
(PRs #1348, #1453).
- Error out if the `RW_block` sampler is assigned to any discrete nodes
(PR #1421).
- Improve the speed of MCMC building in certain cases with many simple samplers
by using `inherits` rather than `is` (PR #1413).
- Add an argument to `buildMCMC` controlling whether to initialize values in
the model (PR #1429).
- Improve the efficiency of setting up derivative information for models
with multivariate nodes with many elements (PR #1431).
- Provide ability to control number of digits printed in C++ output (PR #1145).
- Allow use of categorical MCMC sampler with user-specified `dcat`-like
distributions (PR #1447).
- Update explanation in manual regarding avoiding tracking of derivatives for
some variables in the AD system.
- Warn of use of backward indexing in nimble models.
- Improve documentation of LKJ distribution.
## BUG FIXES
- Fix some internals related to memory handling in compiled code to avoid
intermittent errors and crashes occurring in testing (PR #1430).
- Fix a harmless typo causing partial name matching in R (PR #1422).
- Fix an insufficient check for conjugacy in stickbreaking specifications
(PR #1444).
- Remove spurious warning when `returnType` is `character()` in a
nimbleFunction (issue #1457).
- Fix incorrect error message when `getParam` used with non-existent node
(issue #1338).
## DEVELOPER LEVEL CHANGES
- Ensure parameter transformation system handles cases of zero nodes
(PR #1427).
- Update deprecated `igraph` calls (simply renaming them) (PR #1420).
- Fix compilation failures occurring on Red Hat Linux (PR #1417).
- Remove deprecated `testthat::context` calls (PR #1441).
- Reenable functionality for user-provided Eigen library and related
updates to autoconf configuration (PR #1443).
- Enhance functionality to support model macros (PR #1448).
- Deprecate virtual nodeFunction definitions (PRs #1452, #1454).
- Modify a few test tolerances and expectations of identical values in light
of apparent MacOS changes.
- Save the user environment in the `modelDef` object for use in `nimbleHMC`.
- Remove deprecated `is.na.vec` and `is.nan.vec`.
- Remove deprecated dummy functions for `compareMCMCs` functions (issue #1436).
# CHANGES IN VERSION 1.1.0 (January 2024)
## USER LEVEL CHANGES
- Enhance use of AD in models:
-- Allow use of stochastic indexing in models with AD (PR #1389).
-- Allow use of AD with CAR models, which enables use of HMC on nodes specified
to have `dcar_normal` or `dcar_proper` distributions (PR #1390).
-- Allow distributions and functions (whether user-defined or built-in) that
lack AD support to be used and compiled in AD-enabled models, including
truncated distributions, `dcat`, `dinterval`, and `dconstraint` (PR #1389).
- Add `nimIntegrate`, providing functionality analogous to R's `integrate`,
to the NIMBLE language, providing one-dimensional numerical integration via
adaptive quadrature (PR #1357).
- Add `prior_samples` MCMC sampler, which uses an existing set of
numerical samples to define the prior distribution of model node(s).
- `configureMCMC` will no longer assign samplers to data nodes, even if
the `nodes` argument includes data nodes (PR #1407).
- Add new argument `allowData` to the `addSampler` method of MCMC
configuration objects, with default value `FALSE`. When `TRUE`,
samplers can be assigned to operate on data nodes (PR #1407).
- Handle predictive node dependencies of `dCRP` cluster indicators
by erroring out, but letting users know that setting
`MCMCusePredictiveDependenciesInCalculations` to `TRUE` will make MCMC
possible (PR #1402).
- Rename `expandTarget` and `returnScalarComponents` arguments of `addSampler`
to be `targetByNode` and `multivariateNodesAsScalars`, respectively, to
improve clarity. Also clarify help info for `addSampler` (PR #1375).
- Stop instead of warning when encountering run-time size errors, to avoid
the possibility of incorrect results (PR #1401).
- Add a warning to MCMC sampling of `CAR_normal` nodes when `zero_mean=1`
and the on-the-fly centering causes an invalid model state (PR #1400).
- Cleanly error out when a variable name in a model would conflict with
C++ keywords (PR #1382).
- Warn if indexing in model code uses variables from the user environment
rather than from `constants` (PR #1380).
- Error out rather than warning when there is a missing variable in a
nimbleFunction (PR #1379).
- Allow users to provide list of lists for `inits` in `nimbleModel` (PR #1376).
- Add new control list option, `maxDimCovHistory` to `RW_block` sampler to
specify maximum dimension for saving proposal covariance history.
- Change argument of `besselK` in manual table to be `x` not `k`.
- Do not allow elements of a `nimbleList` to be named `name`, `predefined`,
or `where` (PR #1384).
- Better notify users when automatically generated `r` function for a user-
defined distribution has been removed (PR #1374).
- Error out if there is a default first (`x`) argument in a user-defined
distribution (PR #1371).
- Improve error trapping related to arguments of `getParam` (PR #1370).
- Add information in `nimbleSMC` and `nimbleHMC` samplers to roxygen and manual.
- Improve documentation of omitting variables from AD derivative tracking.
- Update installation guidance in manual.
## DEVELOPER LEVEL CHANGES
- Update to Eigen 3.4.0 but comment out various pragmas in
`DisableStupidWarnings.h` preventing CRAN checks from passing (PR #1406).
- Improve efficiency of `mcmc_determineCalcAndCopyNodes` by avoiding repeated
calls (PR #1333).
- Inline various C++ functions to improve efficiency (PR #1349).
- Add some functionality to support model macros (PR #1361).
- Make change to `nimble-package` documentation to use `"_PACKAGE"`
instead of `@docType` per CRAN request (issue #1359).
- Clean up C++ warnings related to unused variables and typedefs (PR #1408).
- Use `--pre-clean` when invoking `R CMD SHLIB` to do C++ compilation to avoid
sporadic test failures in WAIC tests, seemingly caused by strange timestamp-
related behavior of `make` (PR #1393).
- Fix case of `||` used instead of `|` causing compilation error on M2 Mac
(PR #1392).
- Fix some C++ warnings flagged by CRAN (PR #1386).
- Systematically use `getNimbleOption` in NIMBLE code base.
- Update versions of GitHub Actions canned actions.
## BUG FIXES
- Fix `is.na` and `is.nan` in the NIMBLE DSL to behave in a vectorized fashion
and ensure they mimic behavior in R apart from logical or integer inputs to
`is.na` (PR #1394).
- Remove the `RW_multinomial` MCMC sampler, which was found to generate incorrect
posterior results. A corrected version of this sampler may be
re-introduced into the package, depending on user interest.
- Fix a bug in conjugacy checking in a case of subsets of multivariate nodes
(PR #1331).
- Fix a recycling rule bug involving `pow_int` with a matrix input (PR #1396).
- Fix name-mangling problem that prevented use of periods in names of packages
using nimble (PR #1383).
- Fix handling of `NULL` in `getNimbleOption`.
- Avoid using wrapped sampler on cluster node parameters when using `dCRP`
and assigning a joint sampler (e.g., HMC) to the parameters of the cluster
nodes (PR #1404).
- Avoid spurious warning about missing nimbleFunction when using `nimOptim`
(PR #1378).
- Cleanly error out when an undefined function is used in the `return` statement
of a nimbleFunction (in particular, nested nimbleFunctions) (PR #1381).
- Fix handling of deregistered distribution by removing auto-generated 'r'
function (PR #1377).
- Correct a corner case of reading from a BUGS file (PR #1369).
- Fix incorrect eigenization code related to `besselk` that did not actually
seem to affect behavior (PR #1385).
(math/R-nimble) Updated 1.0.0 to 1.0.1 # CHANGES IN VERSION 1.0.1 (June 2023) ## USER LEVEL CHANGES - Fix bug (introduced in v. 1.0.0) causing incorrect setting of 'data' flag for models with variables containing a mix of data nodes and nodes appearing only on the right-hand side of expressions, for cases where not all elements of the variable are defined (such as capture-recapture models). This also addresses an unanticipated change in behavior in initializing right-hand side only nodes from the `data` argument (PR #1328). - Improved error trapping in MCMC sampler for categorical distributions (PR #1325).
(math/R-nimble) Updated 0.13.1 to 1.0.0
# CHANGES IN VERSION 1.0.0 (May 2023)
This release introduces tools for automatic differentiation in NIMBLE.
## USER LEVEL CHANGES
- Add tools for automatic differentiation. Functionality includes:
-- The ability to differentiate nimbleFunctions with respect
to input arguments in a flexible way.
-- The ability to differentiate `model$calculate()` calls
with respect to model node elements.
-- Functionality that enables Hamiltonian Monte Carlo (provided in the
`nimbleHMC` package).
-- A parameter transformation system to work in unconstrained parameter
spaces when model parameters have constrained domains.
- Add Laplace approximation algorithm, allowing a user to approximate
the marginal likelihood (integration/marginalizing over random effects/
latent process values) and find the MLE.
- Improve aspects of WAIC (PR #1256):
-- Provide aggregate and per-chain WAIC when `perChainWAIC` is `TRUE`.
-- Report number of `pWAIC` values greater than 0.4.
-- Warn user if WAIC is enabled but not set to `TRUE` in `runMCMC`.
-- Improve clarity in `help(WAIC)`.
- Reduce the default adaptation interval for the `AF_slice` sampler to 200.
- Improved control of `addSampler` method of MCMC
configuration objects (PR #1293):
-- `expandTarget` argument controls whether nodes specified in
`target` undergo expansion via `expandNodeNames`, adding a
separate sampler instance for each resulting node.
-- When `expandTarget = TRUE`, the `scalarComponents` argument is
passed as the `returnScalarComponents` argument to `expandNodeNames`.
-- Removed `nodes` argument as redundant. Target nodes are
uniquely specified using the `target` argument.
- Improve handling of resetting of scale when `adaptive=FALSE` (PR #1275).
- Allow `dcat` to have a `prob` vector of length 1 (PR #1251).
- Add error trapping for MCMC `thin` argument not positive and integer-valued
(PR #1250).
- Enhance discussion of MCMC initialization in the User Manual (issue #1247).
- Enhance discussion of indexing in loops and variables in User Manual,
including differences from JAGS.
- Rework language in `help(buildMCMC)` to improve clarity.
- Add information on predefined nimbleLists to the User Manual.
- Improve error message when user-defined distribution has incorrect dimension
for `x`.
- Improve error message when mistakenly using `T()` in deterministic rather than
stochastic model declaration.
- Improve error-trapping when a loop index is incorrectly used in indexing
a block of a variable (PR #1289).
- Error trap use of reduction operations on scalars (PR #1281).
- Error trap some cases of incorrect return type in user-defined simulation
('r') functions (PR #1280).
- Error trap case where a variable name is also used as a loop index variable
(PR #1278).
- Error trap setting deterministic nodes as data in `setData` (PR #1269).
- Better error trap of wrong size/dimensions of in `setInits` (PR #1260).
- Export `clearCompiled`, allowing users to clear compiled objects and unload
the shared library produced during nimble's compilation process (on non-Windows
operating systems).
## BUG FIXES
- Fix bug producing integer overflow in `getDependencyPathCountOneNode`
and improve efficiency of checking maximum number of paths in conjugacy
checking (PR #1322).
- Fix long-standing memory leak in `dinvwish_chol` (PR #1320).
- Fix bug giving incorrect results for `runCrossValidate`, when using the
default MSE loss function and any user-defined loss functions,
but not the 'predictive' loss function. Also, calculate loss when using
the predictive loss using the compiled model rather than the uncompiled model.
(PRs #1298, #1299).
- Fix bug in conjugacy checking that caused incorrect identification of
conjugate relationships with subsets and supersets of multivariate nodes,
as well as inconsistent slices of multivariate nodes (PR #1290).
- Fix `runMCMC` to reset the WAIC state when rerun (PR #1256).
- Fix reset mechanism for WAIC so that one can get WAIC from all the samples
in a chain that is created by multiple calls to the MCMC `$run` method even
when `getWAIC` is called in the middle (PR #1310).
- Fix bug affecting `d=2` case in uncompiled `RW_lkj_corr_cholesky` sampler
(PR #1273).
- Fix aliasing issue arising in assignment operations such as
`nf$a <- nf$a[1:3]` (PR 1301).
- Fix assignment into a block of a model variable (PR #1300).
- Fix compilation error when using `nimSeq` with integers (PR #1282).
- Fix scoping of argument evaluation for `replaceSamplers` method (PR #1287).
- Fix a corner case where particular indexing in model code prevents model
building (PR #1279).
- Fix handling of right-hand side only nodes so not flagged as deterministic
(issue #1269).
- Error trap and fix a bug in handling particular cases in list-like subsetting
(PR #1259).
- Make optimDefaultControlList handle default values completely and with
consistent compiled and uncompiled behavior.
- make nimOptim respect parscale control parameter.
- Update manual installation chapter and `INSTALL` links to gfortran on MacOS.
## DEVELOPER LEVEL CHANGES
- Take `nimbleCppADbaseClass` out of `libnimble.a` and instead make a
session-specific .o file from it to address AD-related crashes on some OSes. (PR
#1318)
- Remove `nimOptim_model` functionality. This fixes build warning on MacOS
involving `nimOptim` (PR #1276).
- Update `Eigen` copyright dates.
- Fix invisible return of `NULL` in nimbleFunctions without explicit return
statements (PR #1254).
- Fix inconsistent use of offset in internal conversion functions (PR #1277).
- Remove references to unsupported `trace` (issue #1262).
# CHANGES IN VERSION 0.13.2 (May 2023)
## DEVELOPER LEVEL CHANGES
- Remove code triggering Windows warnings about writing bytes into region of
size 0 by modifying `setLength`.
- Remove use of C++11 standard, per CRAN requirements. As part of this, replace
use of `std::ptr_fun` (PR #1292).
(math/R-nimble) Updated 0.12.2 to 0.13.1
(From: nimble/inst/NEWS.md)
# CHANGES IN VERSION 0.13.1 (December 2022)
## BUG FIXES
- Fix bug in MCMC sampler inclusion/exclusion of predictive nodes from
target node dependencies (PR #1248).
# CHANGES IN VERSION 0.13.0 (November 2022)
## USER LEVEL CHANGES
- Thoroughly revamp handling of predictive nodes in MCMC sampling. If MCMC
results identical to previous versions of NIMBLE are needed in models with
posterior predictive nodes, set
`nimbleOptions(MCMCusePredictiveDependenciesInCalculations = TRUE)`
and `nimbleOptions(MCMCorderPosteriorPredictiveSamplersLast = FALSE)`.
-- MCMC samplers, by default, will now exclude predictive dependencies
from internal sampler calculations. This can be reverted to the old behavior
of including predictive dependencies in calculations using
`nimbleOptions(MCMCusePredictiveDependenciesInCalculations = TRUE)`.
-- At the time of `buildMCMC`, all `posterior_predictive` samplers are
automatically reordered to operate last among all samplers. Doing so,
posterior predictive samples are generated conditional on the other values
in the MCMC sample. This reordering can be disabled using
`nimbleOptions(MCMCorderPosteriorPredictiveSamplersLast = FALSE)`
(but doing so without also setting
`nimbleOptions(MCMCusePredictiveDependenciesInCalculations = TRUE)` could
result in samples that are invalid in terms of the joint posterior
distribution (but with valid samples marginally).
-- Removal of the `posterior_predictive_branch` sampler. Filling the same
role, the `posterior_predictive` sampler now updates all nodes downstream
of its `target` node. Assignment of the `posterior_predictive` sampler
happens automatically during MCMC configuration, unless
`nimbleOptions(MCMCusePosteriorPredictiveSampler = FALSE)`.
-- Automatic determination of "predictive" model nodes, which are all
stochastic non-data nodes that have no data nodes anywhere in their
downstream dependencies. Tracking of predictive nodes is done
automatically, but maybe be disabled using
`nimbleOptions(determinePredictiveNodesInModel = FALSE)`.
-- New arguments `includePredictive` (default value `TRUE`) and
`predictiveOnly` (default value `FALSE`), for both the `getNodeNames`
and the `getDependencies` methods of model objects. These specify whether
any predictive nodes are included in the results, and whether only
predictive nodes are included, respectively.
-- The MCMC configuration object will issue a warning message if there are
stochastic non-data nodes which will not undergo MCMC sampling. This
warning can be disabled using
`nimbleOptions(MCMCwarnUnsampledStochasticNodes = FALSE)`.
- Add option to WAIC system (via `controlWAIC`) 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
(PR #1244).
- For MCMC configuration `addSampler` method, change name of the
`scalarComponents` argument to `expandComponents` (PR #1215).
- Add new `default` argument for the `addSampler` method of MCMC configuration
objects. When `default = TRUE`, default samplers (conjugate, or otherwise) will
be added to the specified nodes. The addition of this argument provides an
entry point to the logic of default sampler determination and assignment,
without creating a new MCMC configuration object (PR #1215).
- Add new `nodes` argument for the `addSampler` method of MCMC configuration
objects. Nodes specified in `nodes` automatically undergo expansion according
to `expandNodeNames` prior to sampler assignment, allowing for easier assignment
of samplers to multiple nodes (PR #1215).
- `rcar_normal` issues an informative error message when invoked from the R
command line (PR #1243).
- Warn users of unused constants during model building (PR #1242).
- Add `replaceSamplers` method to MCMC configuration objects to simplify
modifying how a node is sampled (PR #1222).
- Convert `NEWS` to Markdown format for proper rendering in browser
(issue #1231).
- Indicate model code that produces warnings about unknown nimbleFunctions
(issue #370).
## BUG FIXES
- Avoid error occurring when a model variable name starts with "logProb"
(PR #1240).
- Avoid error occurring when a model variable is named "i" (PR #1239).
- Prevent infinite recursion in particular cases in conjugacy checking
(PR #1228).
- Fix bug in simulating from `dcar_normal` nodes when multiple nodes passed to
simulate (issue #1238).
- Fix error message about duplicate node declarations (PR #1233).
- Fix another issue with long variable names (PR #1217).
- Fix warning related to `dataNodes` in WAIC.
## DEVELOPER LEVEL CHANGES
- Remove use of bitwise `|` and `&` operators in C++ code, per CRAN request.
- Refactor `nimbleMCMC` to pull out model creation (PR #1223).
- Fix an issue with nested `nimbleList`s on MacOS (PR #1213).
math/R-nimble: Add tool dependency on gmake. A library, libnimble.a, is compiled by this package using a Gnu makefile. Add a tool dependency on gmake to avoid syntax errors.
(math/R-nimble) Updated 0.11.1 to 0.12.2, NEWS.md unknown
(math/R-nimble) Updated 0.9.0 to 0.11.1
(from: inst/NEWS)
CHANGES IN VERSION 0.11.1 (May 2021)
USER LEVEL CHANGES
-- Add information about categorical sampler and univariate version of ESS
sampler to `help(samplers)`.
BUG FIXES
-- Fix to the `posterior_predictive_branch` MCMC sampler, to update
the log-probabilities of the sampled posterior predictive nodes (PR #1127).
CHANGES IN VERSION 0.11.0 (April 2021)
USER LEVEL CHANGES
-- Add new `posterior_predictive_branch` MCMC sampler, which is
automatically assigned to trailing dependency node networks of entirely
non-data nodes (jointly posterior predictive branches). This sampler
simulates jointly from the predictive distribtion of these posterior
predictive node branches, and is designed to improve MCMC mixing of the
branch, and consequently of the entire model (PR #1086).
-- Allow use of elliptical slice sampler for univariate nodes, which can be
useful in multimodal problems (PR #1109).
-- Add a `getParents` method to the model API, allowing one to determine parent
nodes, analogous to use of `getDependencies` to determine child nodes
(PR #1094).
-- Add `getConditionallyIndependentSets` method (not yet documented) to the model
API, allowing one to determine nodes that are conditionally independent of
each other given parent nodes (PR #1094).
-- Improve efficiency of conjugate samplers by avoiding unneeded calculations
when a conjugate relationship does not involve shifting or scaling (PR #1087).
-- Allow use of `nimNumeric`, `nimMatrix`, `nimArray` in model code (PR #1096).
-- Add progress bar to `getSamplesDPmeasure` (NCT issue 110).
-- Allow model definition using `if` without `else`, fixing a longstanding
oversight (PR #1104).
-- Improve warning when multiple nodes provided to `getParam` (PR #1118).
-- Check during model building for unnamed elements of `data` and `inits`
(PR #1117).
-- Remove error trapping to prevent use of variables in defining node names,
such as `getDependencies('y[idx]')` as this is hard to check robustly and
efficiently (PR #1122).
-- Improve error messages when reporting `getParam` cannot calculate a parameter
when checking a model (PR #1112).
-- Error trap cases where model nodes are defined in two different declarations,
adding check for overlapping multivariate nodes (PR #1110).
-- Improve error trapping of mis-formed stochastic declarations in models
(PR #1106).
-- Increase maximum length of compiler output when using
`compileNimble(..., showCompilerOutput = TRUE)` (NCT issue 205).
-- Point to parallelization example on r-nimble.org in relevant places of manual.
BUG FIXES
-- Fix a bug (issue #1091) causing incorrect node names when having more than
100,000 elements in a vector node or in a dimension of a multi-dimensional
node (PR #1092).
-- Fix `getNodeNames` to return no nodes when `latentOnly` is `TRUE` and model
contains no latent nodes (PR #1116).
-- Fix checking for unknown nimbleFunction methods and improve related error
trapping (PRs #1107, #1105).
DEVELOPER LEVEL CHANGES
-- Update our testing code/infrastructure to use latest testthat API (PR #1090).
-- Shift internal code to use `model$calculate(...)` style rather than
`calculate(model, ...)` style for various node functions (PR #1114).
-- Clean up commented out code (PR #1098) and remove unused test files
(PR #1097).
-- Update to a newer (but not latest) version of Eigen to suppress some compiler
warnings (PR #1093).
CHANGES IN VERSION 0.10.1 (November 2020)
USER LEVEL CHANGES
-- Add `round` argument to `samplesSummary` (PR #1077).
-- `samplesSummary` function (and also `runMCMC(..., summary = TRUE)`) was made
to be robust against non-valid values in posterior samples array (PR #1075).
BUG FIXES
-- Fix `makeParamInfo` when there is only one declID involved to address a bug
affecting usage of `getParam`. This bug was introduced in version 0.10.0 when
reducing memory use of `getParam` (PR #1016). This fixes incorrect behavior
of conjugate samplers (because of incorrect inputs from `getParam`) under
certain model structures, in particular state-space style models (PR #1080).
-- Prevent usage of marginal version of WAIC (i.e., when not monitoring all
direct stochastic parents of data nodes); use of marginal version of WAIC in
previous versions gave incorrect results (PR #1083).
DEVELOPER LEVEL CHANGES
-- Deprecate `samplerAssignmnentRules` system (PR #1078).
-- Deprecate `autoBlock` MCMC option (PR #1079).
CHANGES IN VERSION 0.10.0 (October 2020)
USER LEVEL CHANGES
-- Greatly extend BNP functionality with the CRP (Chinese restaurant process)
distribution by allowing multiple observations to be grouped together (e.g.,
for longitudinal or time series data) without requiring they be specified
as a multivariate node (PR #1033).
-- Add a variety of conjugate cases to BNP conjugate samplers (PR #1033).
-- Greatly improve efficiency of model and MCMC building and configuration for
BNP-based models with CRP components (PR #1033).
-- Move all sequential Monte Carlo (SMC; aka particle filtering) methods to
new package `nimbleSMC`, including various particle-filter-based MCMC
samplers.
-- Prevent use of variables in indexes of nodes, such as `y[idx]`, which was
incorrectly being evaluated based on R scoping rules (PR #1064).
-- Allow use of `logdet` in model code (Issue #1018).
-- New `resetMV` argument available to `mcmc$run` method. In combination
with `reset = FALSE`, specifying `resetMV = TRUE` will continue the current
run of the MCMC, but discard any previously-collected samples
(PR #1051; thanks to 'DJRP').
-- New methods `setMonitors` and `setMonitors2` added for MCMC configuration
objects. These methods replace the current set of monitors (or monitors2)
with the specified variables (PR #1061).
-- Add `as.list` method for modelValues objects (PR #1060).
-- Update `getSamplesDPmeasure` function to improve efficiency and reduce
output size; output is now a list of matrices (PR #1059).
-- Add `dimensions` argument to `nimbleMCMC` (PR #1058).
-- Add method `getWidthHistory` to slice sampler to retrieve sampling history
information (PR #1057; thanks to 'rpatin').
-- Various improvements to the manual.
BUG FIXES
-- Fix a bug in k-fold cross-validation routine (`runCrossValidate`), where
the merging of MCMC sampler configurations was done incorrectly and causing
incorrect results (PR #1068).
-- Fix bug giving incorrect `dwish` density when using non-default S
parameterization (PR #1017).
-- Fix incorrect NaN eigenvalues in singular normalized adjacency matrices
under `dcar_normal` (PR #1019).
-- Update all MCMC sampler functions to use a new syntax for control list
element extraction, which prevents a possible bug caused by R's partial
matching of list names (PR #1065).
-- Define auto-generated simulation ('r') functions for user-defined
distributions in the global environment to avoid scoping issues (PR #1063).
-- Update user-defined distribution processing so user-defined distributions
can be defined inside functions (PR #1063).
-- Fix bug preventing use of `dirName` argument to `compileNimble` (PR #1062).
-- Fix a bug preventing model building when there are overly long names of
model variables resulting from long deterministic expressions in model code
(PR #1069).
-- Fix `buildMCEM` so it works with a compiled model as argument (PR #1028).
-- Fix `dmvt` so default unnamed parameters work (PR #1027).
-- Fix error in model building in corner case where
`makeVertexNamesFromIndexArray2` made a simplifying assumption to conclude
a block of nodes was contiguous (PR #1026).
-- Fix bug in `nimbleRcall` causing run-time warnings when `returnType` is void
(PR #1013).
DEVELOPER LEVEL CHANGES
-- Improve efficiency of `getParam` implementation, which improves speed for
MCMC compilation (PR #1016).
-- Improve MCMC sampling efficiency by not copying data nodes, only data node
logProbs, during sampler execution for various samplers (PR #1040).
-- Update Travis testing to use R 4.0.
-- Remove `GID_map` internal to modelValues (PR #1032).
-- Remove deprecated function `getLoadingNamespace` and (deprecated) use of
`where=getLoadingNamespace`. Also improve handling of environments set up
by `nimbleFunction` to make it easier to write packages depending on NIMBLE
(PRs #1029, 1011).
-- Force intermediates of index range expressions to be of type 'int' for use
in AD (PR #1024).
CHANGES IN VERSION 0.9.1 (May 2020)
USER LEVEL CHANGES
-- Switched from use of `system` to `system2` to avoid problems with installation
under R 4.0 on Windows (PR #1003).
-- Modify various adaptive MCMC samplers so the exponent controlling the scale
decay of the adaptation is adjustable by user (rather than hard-coded at 0.8
(PR #981).
-- Allow `pmin` and `pmax` to be used in models (PR #982).
-- Add documentation for `is.na`,`is.nan`,`any`,`all` (PR #988)
-- Add system option `MCMCuseConugacy` to control whether conjugate samplers are
used (PR #998).
-- Adds checks for `niter`, `nburnin` in the `mcmc$run` method (PR #980).
-- Modify print handling in `addSampler` and `configureMCMC` (PRs #986, 989).
-- Improve handling of NA values in `dCRP` to avoid error messages when building
models (PR #994).
-- Avoid monitoring top-level data nodes in models (PR #1006).
BUG FIXES
-- Modify MCMC `autoBlock` routine to only group Wishart, Inverse-Wishart, and
Dirichlet nodes with themselves, to avoid violating the constraints of those
nodes (PR #999).
-- Fix incorrect error message from `warnRHSonlyDynIdx` when variable appears
multiple times on right-hand side of a model expression (PR #997).
-- Fix `checkDistributionFunctions` to respect default `nDim=0` when extracting
first argument, to avoid error when dimension not specified in user-defined
distributions (PR #992).
-- Fix `print` option of `addSampler` (PR #986).
-- Improve handling of cases where indexing goes beyond extent of variable in
`expandNodeNames` and related queries of model structure (PR #977).
DEVELOPER LEVEL CHANGES
-- Use `inherits` rather than testing for equality of `class(object)` (PR #988).
Add missing R-R6 dependency
math/R-nimble: import R-nimble-0.9.0 A system for writing hierarchical statistical models largely compatible with 'BUGS' and 'JAGS', writing nimbleFunctions to operate models and do basic R-style math, and compiling both models and nimbleFunctions via custom- generated C++. 'NIMBLE' includes default methods for MCMC, particle filtering, Monte Carlo Expectation Maximization, and some other tools. The nimbleFunction system makes it easy to do things like implement new MCMC samplers from R, customize the assignment of samplers to different parts of a model from R, and compile the new samplers automatically via C++ alongside the samplers 'NIMBLE' provides. 'NIMBLE' extends the 'BUGS'/'JAGS' language by making it extensible: New distributions and functions can be added, including as calls to external compiled code. Although most people think of MCMC as the main goal of the 'BUGS'/'JAGS' language for writing models, one can use 'NIMBLE' for writing arbitrary other kinds of model-generic algorithms as well. A full User Manual is available at <https://r-nimble.org>.