Download NIMBLE User Manual
Transcript
CONTENTS 2 5 Building models 5.1 NIMBLE support for features of BUGS . . . . . . . . 5.1.1 Supported features of BUGS . . . . . . . . . . 5.1.2 Not-yet-supported features of BUGS . . . . . 5.1.3 Extensions to BUGS . . . . . . . . . . . . . . 5.2 Creating models . . . . . . . . . . . . . . . . . . . . . 5.2.1 Using nimbleModel() to specify a model . . . 5.2.2 More about specifying data nodes and values . 5.2.3 Using readBUGSmodel() to specify a model . 5.2.4 A note on introduced nodes . . . . . . . . . . 5.3 More details on NIMBLE support of BUGS features . 5.3.1 Distributions . . . . . . . . . . . . . . . . . . 5.3.2 List of parameterizations . . . . . . . . . . . . 5.3.3 List of BUGS language functions . . . . . . . 5.3.4 List of link functions . . . . . . . . . . . . . . 5.3.5 Indexing . . . . . . . . . . . . . . . . . . . . . 5.3.6 Censoring and truncation . . . . . . . . . . . 5.4 Compiling models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Using NIMBLE models from R 6.1 Some basic concepts and terminology . . . . . . . . . . 6.2 Accessing variables . . . . . . . . . . . . . . . . . . . . 6.2.1 Accessing log probabilities via logProb variables 6.3 Accessing nodes . . . . . . . . . . . . . . . . . . . . . . 6.3.1 How nodes are named . . . . . . . . . . . . . . 6.3.2 Why use node names? . . . . . . . . . . . . . . 6.4 calculate(), simulate(), and getLogProb() . . . . . 6.4.1 For arbitrary collections of nodes . . . . . . . . 6.4.2 Direct access to each node’s functions . . . . . . 6.5 Querying model parameters . . . . . . . . . . . . . . . 6.6 Querying model structure . . . . . . . . . . . . . . . . 6.6.1 getNodeNames() and getVarNames() . . . . . . 6.6.2 getDependencies() . . . . . . . . . . . . . . . 6.6.3 isData() . . . . . . . . . . . . . . . . . . . . . 6.7 The modelValues data structure . . . . . . . . . . . . . 6.7.1 Accessing contents of modelValues . . . . . . . 6.8 NIMBLE passes objects by reference . . . . . . . . . . 7 MCMC 7.1 The MCMC specification . . . . . . . . . . . . 7.1.1 Default MCMC specification . . . . . . 7.1.2 Customizing the MCMC specification . 7.2 Building and compiling the MCMC algorithm 7.3 Executing the MCMC algorithm . . . . . . . . 7.4 Extracting MCMC samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 23 23 23 24 25 25 26 28 28 29 29 32 32 33 33 36 36 . . . . . . . . . . . . . . . . . 37 37 37 38 39 39 40 40 41 42 43 43 43 44 45 46 47 50 . . . . . . 52 52 53 54 57 58 59