Download NIMBLE User Manual
Transcript
CONTENTS 7.5 7.6 7.7 7.8 3 Sampler Algorithms provided with NIMBLE . . . . . . . . . . . . . . . 7.5.1 Terminal node end Sampler . . . . . . . . . . . . . . . . . . . . 7.5.2 Scalar Metropolis-Hastings random walk RW sampler . . . . . . 7.5.3 Multivariate Metropolis-Hastings RW block sampler . . . . . . . 7.5.4 Slice sampler . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.5.5 Hierarchical crossLevel sampler . . . . . . . . . . . . . . . . . . 7.5.6 RW llFunction sampler using a specified log-likelihood function 7.5.7 Conjugate samplers . . . . . . . . . . . . . . . . . . . . . . . . . Detailed MCMC example: litters . . . . . . . . . . . . . . . . . . . . . Higher level usage: MCMC Suite . . . . . . . . . . . . . . . . . . . . . 7.7.1 MCMC Suite example: litters . . . . . . . . . . . . . . . . . . . 7.7.2 MCMC Suite outputs . . . . . . . . . . . . . . . . . . . . . . . . 7.7.3 Custom arguments to MCMC Suite . . . . . . . . . . . . . . . . Advanced topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.8.1 Custom sampler functions . . . . . . . . . . . . . . . . . . . . . 8 Other algorithms provided by NIMBLE 8.1 Basic Utilities . . . . . . . . . . . . . . . . . . . . . . . 8.1.1 simNodes, calcNodes, and getLogProbs . . . . 8.1.2 simNodesMV, calcNodesMV, and getLogProbsMV 8.2 Particle filter . . . . . . . . . . . . . . . . . . . . . . . 8.3 Monte Carlo Expectation Maximization (MCEM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 60 61 61 63 63 64 65 65 69 69 70 71 73 73 . . . . . . . . . . . . . . . 76 76 76 78 79 80 . . . . . . . . . . . . . . . . . . . . . 82 82 84 84 85 86 87 87 87 88 88 92 92 93 93 94 94 95 96 97 98 100 9 Programming with models 9.1 Writing nimbleFunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Using and compiling nimbleFunctions . . . . . . . . . . . . . . . . . . . . . 9.2.1 Accessing and modifying numeric values from setup . . . . . . . . . 9.3 Compiling numerical operations with no model: omitting setup code . . . 9.4 Useful tools for setup functions . . . . . . . . . . . . . . . . . . . . . . . . 9.4.1 Control of setup outputs . . . . . . . . . . . . . . . . . . . . . . . 9.5 NIMBLE language components . . . . . . . . . . . . . . . . . . . . . . . . 9.5.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.2 Driving models: calculate, simulate, and getLogProb . . . . . . . . 9.5.3 Accessing model and modelValues variables and using copy . . . . . 9.5.4 Using model variables and modelValues in expressions . . . . . . . . 9.5.5 Getting and setting more than one model node or variable at a time 9.5.6 Basic flow control: if-then-else, for, and while . . . . . . . . . . . . 9.5.7 How numeric types work . . . . . . . . . . . . . . . . . . . . . . . . 9.5.8 Declaring argument types and the return type . . . . . . . . . . . . 9.5.9 Querying and changing sizes . . . . . . . . . . . . . . . . . . . . . . 9.5.10 Basic math and linear algebra . . . . . . . . . . . . . . . . . . . . . 9.5.11 Including other methods in a nimbleFunction . . . . . . . . . . . . 9.5.12 Using other nimbleFunctions . . . . . . . . . . . . . . . . . . . . . . 9.5.13 Virtual nimbleFunctions and nimbleFunctionLists . . . . . . . . . . 9.5.14 print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .