Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

initializeModel

Performs initialization of nimble model node values and log probabilities


Description

Performs initialization of nimble model node values and log probabilities

Usage

initializeModel(model, silent = FALSE)

Arguments

model

A setup argument, which specializes an instance of this nimble function to a particular model.

silent

logical indicating whether to suppress logging information

Details

This nimbleFunction may be used at the beginning of nimble algorithms to perform model initialization. The intended usage is to specialize an instance of this nimbleFunction in the setup function of an algorithm, then execute that specialied function at the beginning of the algorithm run function. The specialized function takes no arguments.

Executing this function ensures that all right-hand-side only nodes have been assigned real values, that all stochastic nodes have a real value, or otherwise have their simulate() method called, that all deterministic nodes have their simulate() method called, and that all log-probabilities have been calculated with the current model values. An error results if model initialization encounters a problem, for example a missing right-hand-side only node value.

Author(s)

Daniel Turek

Examples

myNewAlgorithm <- nimbleFunction(
   setup = function(model, ...) {
      my_initializeModel <- initializeModel(model)
      ....
   },
   run = function(...) {
      my_initializeModel()
      ....
   }
)

nimble

MCMC, Particle Filtering, and Programmable Hierarchical Modeling

v0.11.0
BSD_3_clause + file LICENSE | GPL (>= 2)
Authors
Perry de Valpine [aut], Christopher Paciorek [aut, cre], Daniel Turek [aut], Nick Michaud [aut], Cliff Anderson-Bergman [aut], Fritz Obermeyer [aut], Claudia Wehrhahn Cortes [aut] (Bayesian nonparametrics system), Abel Rodrìguez [aut] (Bayesian nonparametrics system), Duncan Temple Lang [aut] (packaging configuration), Sally Paganin [aut] (reversible jump MCMC), Jagadish Babu [ctb] (code for the compilation system for an early version of NIMBLE), Lauren Ponisio [ctb] (contributions to the cross-validation code), Peter Sujan [ctb] (multivariate t distribution code)
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.