1 / 9

Introduction to MCMC and BUGS

Introduction to MCMC and BUGS. Computational problems. More parameters -> even more parameter combinations Exact computation and grid approximation become infeasible The posterior distribution can be approximated faster by simulation techniques

fleta
Download Presentation

Introduction to MCMC and BUGS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to MCMC and BUGS

  2. Computational problems • More parameters -> even more parameter combinations • Exact computation and grid approximation become infeasible • The posterior distribution can be approximated faster by simulation techniques • Simulation: drawing random numbers from a distribution

  3. Simulation

  4. Markov chain Monte Carlo • Draw random numbers from the posterior distribution • Each number depends on the previous one • Start from arbitrary value • Simulation “finds” the posterior distribution and provides random numbers from it • Advantage: very complex models can be analysed • Disadvantage: length of the searching phase is difficult to identify

  5. Remarks • MCMC is only one way to approximate the posterior distribution. It is not a modeling approach itself! • There are other methods as well: • Importance sampling • Sampling- Importance –Resampling • Sequential Monte Carlo (particle filter) • etc. • MCMC usually easier to set up

  6. BUGS • Bayesian Inference Using Gibbs Sampling • Gibbs sampling is one form of MCMC • User specifies the model structure • User inputs the data • Software uses Bayes’ theorem and constructs an MCMC algorithm to sample from the posterior • User assesses the convergence of MCMC • Use software to calculate descriptive statistics and produce figures

  7. Using BUGS • Lots of pointing and clicking • Some time is needed to learn the procedure • Also a scripting language is available • Routine points and clicks can be automated • Useful once you know how to point and click • R interface • BUGS can be used from R by the same scripting language • Results are exported to R for further analysis

  8. How to point and click • Follow these steps to specify a simple model and simulate the posterior distribution • Start BUGS : winbugs.exe • Create new document: File ->New • Write a model specification to the blank document: model{ x~dnorm(10,0.25) }

  9. Running the simulation: • Model ->Specification… • Specification Tool: check model • [Activate the document or area that contains data] • [Specification tool: load data] • Specification tool: compile • [Activate the document or area that contains the set of initial values] • [Specification tool: load inits] • Specification tool: gen inits • Inference -> Samples… • Sample monitor tool: node : “x” • Sample monitor tool: set • Model -> Update… • Update tool: refresh: “1” • Update tool: update • Sample monitor tool: node: “x” • Sample monitor tool: history • Sample monitor tool: stats • Sample monitor tool: density

More Related