楼主: Lisrelchen
2038 0

[Case Study]Bayesian Multilevel Modeling using Python [推广有奖]

  • 0关注
  • 62粉丝

VIP

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50164 个
通用积分
81.5628
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

Hierarchical or multilevel modeling is a generalization of regression modeling. Multilevel models are regression models in which the constituent model parameters are given probability models. This implies that model parameters are allowed to vary by group. Observational units are often naturally clustered. Clustering induces dependence between observations, despite random sampling of clusters and random sampling within clusters.


A hierarchical model is a particular multilevel model where parameters are nested within one another.Some multilevel structures are not hierarchical. e.g. "country" and "year" are not nested, but may represent separate, but overlapping, clusters of parameters. We will motivate this topic using an environmental epidemiology example.

  1. from pymc import Normal, Model, Uniform

  2. with Model() as partial_pooling:
  3.    
  4.     # Priors
  5.     mu_a = Normal('mu_a', mu=0., tau=0.0001)
  6.     sigma_a = Uniform('sigma_a', lower=0, upper=100)
  7.     tau_a = sigma_a**-2
  8.    
  9.     # Random intercepts
  10.     a = Normal('a', mu=mu_a, tau=tau_a, shape=len(set(county)))
  11.    
  12.     # Model error
  13.     sigma_y = Uniform('sigma_y', lower=0, upper=100)
  14.     tau_y = sigma_y**-2
  15.    
  16.     # Expected value
  17.     y_hat = a[county]
  18.    
  19.     # Data likelihood
  20.     y_like = Normal('y_like', mu=y_hat, tau=tau_y, observed=log_radon)
复制代码

本帖隐藏的内容

Bayesian Multilevel Analysis using Python.pdf (4.48 MB)


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Case study Multilevel Bayesian Modeling python particular naturally between within where

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-11-5 19:26