Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to MCMC and BUGS. Computational problems More parameters -> even more parameter combinations Exact computation and grid approximation become.

Similar presentations


Presentation on theme: "Introduction to MCMC and BUGS. Computational problems More parameters -> even more parameter combinations Exact computation and grid approximation become."— 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 1. User specifies the model structure 2. User inputs the data 3. Software uses Bayes’ theorem and constructs an MCMC algorithm to sample from the posterior 4. User assesses the convergence of MCMC 5. 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 1. Start BUGS : winbugs.exe 2. Create new document: File ->New 3. Write a model specification to the blank document: model{ x~dnorm(10,0.25) }

9 Running the simulation: 4. Model -> Specification… 5. Specification Tool: check model 6. [Activate the document or area that contains data] 7. [Specification tool: load data] 8. Specification tool: compile 9. [Activate the document or area that contains the set of initial values] 10. [Specification tool: load inits] 11. Specification tool: gen inits 12. Inference -> Samples… 13. Sample monitor tool: node : “x” 14. Sample monitor tool: set 15. Model -> Update… 16. Update tool: refresh: “1” 17. Update tool: update 18. Sample monitor tool: node: “x” 19. Sample monitor tool: history 20. Sample monitor tool: stats 21. Sample monitor tool: density


Download ppt "Introduction to MCMC and BUGS. Computational problems More parameters -> even more parameter combinations Exact computation and grid approximation become."

Similar presentations


Ads by Google