./math/R-nimble, MCMC, Particle Filtering, and Programmable Hierarchical Modeling

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 1.3.0, Package name: R-nimble-1.3.0, Maintainer: pkgsrc-users

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>.


Master sites: (Expand)


Version history: (Expand)


CVS history: (Expand)


   2025-02-15 06:46:28 by Makoto Fujiwara | Files touched by this commit (2) | Package updated
Log message:
(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).
   2023-06-17 14:41:54 by Makoto Fujiwara | Files touched by this commit (2)
Log message:
(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).
   2023-06-11 05:24:46 by Makoto Fujiwara | Files touched by this commit (2)
Log message:
(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).
   2023-03-11 11:05:26 by Makoto Fujiwara | Files touched by this commit (2) | Package updated
Log message:
(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).
   2022-08-31 20:41:07 by Brook Milligan | Files touched by this commit (1)
Log message:
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.
   2022-04-28 17:52:38 by Makoto Fujiwara | Files touched by this commit (2)
Log message:
(math/R-nimble) Updated 0.11.1 to 0.12.2, NEWS.md unknown
   2021-10-26 12:56:13 by Nia Alarie | Files touched by this commit (458)
Log message:
math: Replace RMD160 checksums with BLAKE2s checksums

All checksums have been double-checked against existing RMD160 and
SHA512 hashes
   2021-10-07 16:28:36 by Nia Alarie | Files touched by this commit (458)
Log message:
math: Remove SHA1 hashes for distfiles