楼主: oliyiyi
221 3

Bayesian workflow for model checking and model improvement [推广有奖]

版主

大师

84%

还不是VIP/贵宾

-

TA的文库  其他...

计量文库

威望
6
论坛币
624264 个
学术水平
1322 点
热心指数
1425 点
信用等级
1228 点
经验
324567 点
帖子
8643
精华
66
在线时间
4861 小时
注册时间
2007-5-21
最后登录
2019-3-17

初级学术勋章 初级热心勋章 初级信用勋章 中级信用勋章 中级学术勋章 中级热心勋章 高级热心勋章 高级学术勋章 高级信用勋章 特级热心勋章 特级学术勋章 特级信用勋章

oliyiyi 发表于 2019-1-12 22:23:50 |显示全部楼层

In Bayesian inference we make a sort of deal with the devil: we commit to a strong model, and from this we get strong inferences. But, as the saying goes, with great power comes great responsibility. We need to vigilantly check the fit of our models, following this up with model improvement. As a result, Bayesian workflow does not involve fitting just one model to data. We typically fit multiple models, including some models that we know are too simple (to get a sense of what is lost by not including certain features in our analysis) and others that we suspect are too complex (to get a sense of the boundaries of what we can learn given the resolution of the our available data).

Model checking consists of the following steps:

  • Simulate fake data. Specify sizes and values for all predictors in a model and choose a set of values for all model parameters and generate the corresponding data values <span id="MathJax-Element-6-Frame" class="mjx-chtml MathJax_CHTML" tabindex="0" data-mathml="y" role="presentation" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; -webkit-tap-highlight-color: transparent; text-size-adjust: none; display: inline-table; line-height: 0; font-size: 25.92px; letter-spacing: normal; overflow-wrap: normal; word-spacing: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding-top: 1px; padding-bottom: 1px; position: relative;">yy.

  • Fit the model. Express the model in Stan, pass the simulated data into the program, and estimate the parameters.

  • Evaluate the fit. Compare the estimated parameters (or, more fully, the posterior distribution of the parameters) to their true values, which in this simulated-data scenario are known.




缺少币币的网友请访问有奖回帖集合
http://bbs.pinggu.org/thread-3990750-1-1.html
stata SPSS
oliyiyi 发表于 2019-1-21 23:22:30 |显示全部楼层

Be sure that your Stan programs ends in a blank line without any characters including spaces and comments.

In this Stan program, we let theta be a transformation of mu, eta, and tau instead of declaring theta in the parameters block, which allows the sampler will run more efficiently (see detailed explanation). We can prepare the data (which typically is a named list) in R with:
回复

使用道具 举报

oliyiyi 发表于 2019-1-22 16:58:17 |显示全部楼层
The object fit, returned from function stan is an S4 object of class stanfit. Methods such as print, plot, and pairs are associated with the fitted result so we can use the following code to check out the results in fit. print provides a summary for the parameter of the model as well as the log-posterior with name lp__ (see the following example output). For more methods and details of class stanfit, see the help of class stanfit.
回复

使用道具 举报

oliyiyi 发表于 2019-1-23 20:11:37 |显示全部楼层
The object fit, returned from function stan is an S4 object of class stanfit. Methods such as print, plot, and pairs are associated with the fitted result so we can use the following code to check out the results in fit. print provides a summary for the parameter of the model as well as the log-posterior with name lp__ (see the following example output). For more methods and details of class stanfit, see the help of class stanfit.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 我要注册

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2019-3-20 07:56