首页 学会运行winbugs-step by step图文并茂

学会运行winbugs-step by step图文并茂

举报
开通vip

学会运行winbugs-step by step图文并茂 Bayes by the Beach -- How to Use WINBUGS on Gary King's U.K. Elections Data WINBUGS is not user friendly! Accordingly, I will go through the U.K. Elections data application step-by-step. First and overview and then step by step screen shots. Overview: 1. M...

学会运行winbugs-step by step图文并茂
Bayes by the Beach -- How to Use WINBUGS on Gary King's U.K. Elections Data WINBUGS is not user friendly! Accordingly, I will go through the U.K. Elections data application step-by-step. First and overview and then step by step screen shots. Overview: 1. Model ® Specification ® 2. double-click "model" in Document Window 3. ® Check Model 4. double-click "list" under "data' in Document Window 5. ® Load Data 6. ® Compile 7. double-click "list" under "inits" in Document Window 8. ® Load Inits 9. Inference ® Samples ® type "rho" ® set 10. Inference ® Samples ® type "bias" ® set 11. Inference ® Samples ® type "rho" ® trace 12. Inference ® Samples ® type "bias" ® trace 13. Model ® Update ® type number in box ® update 14. [Bring "Sample Monitoring Tool" to front] ® select "rho" ® stats 15. ® select "bias" ® stats After starting WINBUGS use the normal Windows file-open drop-down to grab the king_england_royce.odc document (actually, it is a binary file) file: 1. This is what you see after king_england_royce.odc loads. The file contains the model, the data, and the intial values.2. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第1页 共15页 2009-7-10 13:27 The first step is to select "Specification" from the drop-down "Model" Menu:3. The "Specification Tool" dialog box appears. This is used to check the model.4. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第2页 共15页 2009-7-10 13:27 Double-Click on "model" in king_england_royce.odc and it highlights the word:5. Click the "check model" button to check the model:6. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第3页 共15页 2009-7-10 13:27 Because the model is OK (this may not always be true!) a dialog box pops up telling you that it will replace the old model. Click OK.7. Double-Click on "list" below the word "data" to load the data:8. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第4页 共15页 2009-7-10 13:27 Click "load data" to load the data into the program.9. Click "compile" to make the program ready to run.10. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第5页 共15页 2009-7-10 13:27 Double-Click on "list" below the word "Inits" to load the intial values:11. Click "load inits".12. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第6页 共15页 2009-7-10 13:27 Now you have to set up your sample monitoring. Click the "Inferences" drop-down box and select "Samples":13. This brings up the Sample Monitoring Tool:14. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第7页 共15页 2009-7-10 13:27 The parameters are rho, and the 3-length vector bias. (One value of bias is held constant.) In the "node" window type "rho" and then click set: 15. Now type "bias" and click "set:16. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第8页 共15页 2009-7-10 13:27 Go back and select "rho"17. and click "trace". This brings up a window that will show the MCMC iterations for rho.18. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第9页 共15页 2009-7-10 13:27 Select "bias" and click "trace" and it brings up a two panel window that will show the MCMC iterations for the two bias variables.19. The Model is almost ready to run! Click the "model" drop-down box and select "Update":20. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第10页 共15页 2009-7-10 13:27 This brings up the "Update Tool". Set the updates to 10000 (you can do more but 10000 is safe)21. and click "update" and the model runs!22. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第11页 共15页 2009-7-10 13:27 Note the appearance of "10000" in the gray "iteration" box and the red tracelines in the parameter windows.23. Bring the "Sample Monitoring Tool" back to the foreground (its been there the whole time) and click "stats":24. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第12页 共15页 2009-7-10 13:27 This brings up the usual descriptive statistics (with a Bayesian twist!) for the two "bias" parameters.25. Select "rho" in the "Sample Monitoring Tool" and click "stats":26. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第13页 共15页 2009-7-10 13:27 and you get the usual descriptive statistics (with a Bayesian twist!) for the rho parameter. Note that this window popped up over the bias statistics window. You can move these around any way you want. 27. Here is everything rearranged so you can see it.28. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第14页 共15页 2009-7-10 13:27 In this final screen shot the results of classical Maximum-Likelihood run in R can be seen in the background with the final results from the Bayesian posterior. The two are essentially the same. 29. Bayes by the Beach -- How to Use WINBUGS on Gary King's Datahttp://voteview.ucsd.edu/How_to_Use_WINBUGS_on_England_D... 第15页 共15页 2009-7-10 13:27
本文档为【学会运行winbugs-step by step图文并茂】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_850714
暂无简介~
格式:pdf
大小:2MB
软件:PDF阅读器
页数:15
分类:
上传时间:2013-01-13
浏览量:57