16032 107

Simon Jackman:Bayesian Analysis for the Social Sciences(Using JAGS)   [推广有奖]

  • 0关注
  • 10粉丝

已卖:1624份资源

教授

8%

还不是VIP/贵宾

-

TA的文库  其他...

Must-Read Book

Winrats NewOccidental

Matlab NewOccidental

威望
1
论坛币
31404 个
通用积分
4.4011
学术水平
96 点
热心指数
43 点
信用等级
79 点
经验
9658 点
帖子
287
精华
10
在线时间
40 小时
注册时间
2013-12-14
最后登录
2024-4-12

楼主
农村固定观察点 发表于 2014-6-19 11:22:26 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币


Bayesian Analysis for the Social Sciences

Simon Jackman


ISBN: 978-0-470-01154-6


598 pages


November 2009



Bayesian Analysis for the Social Sciences provides a thorough yet accessible treatment of Bayesian statistical inference in social science settings.

The first part of this book presents the foundations of Bayesian inference, via simple inferential problems in the social sciences: proportions, cross-tabulations, counts, means and regression analysis. A review of modern, simulation-based inference is presented with a detailed examination of the suite of computational tools (Markov chain Monte Carlo algorithms) that underlie the “Bayesian revolution” in contemporary statistics. Furthermore, the book introduces the general purpose Bayesian computer programs BUGS and JAGS along with numerous examples, and a detailed consideration of the art of using these programs in real-world settings.


The second half of the book focuses on intermediate to advanced applications in the social sciences, including hierarchical or “multi-level” models, models for discrete responses (binary, ordinal, and multinomial data), measurement models (factor analysis, item-response models, dynamic linear models), and mixture models, along with models that are interesting hybrids of these models.  Each model is accompanied by worked examples using BUGS/JAGS, using data from political science, sociology, psychology, education, communications, economics and anthropology.


Each chapter is accompanied with exercises to further the students' understanding of Bayesian methods and applications.  Extensive appendices provide important technical background and proofs of key theoretical propositions.




http://bcs.wiley.com/he-bcs/Books?action=index&bcsId=5422&itemId=0470011548

本帖隐藏的内容

Bayesian Analysis for the Social Sciences Simon Jackman Wiley.rar (6.18 MB, 需要: 10 个论坛币)




二维码

扫码加我 拉你入群

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

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

关键词:Sciences Analysis Bayesian Analysi Jackman accessible problems provides science simple

本帖被以下文库推荐

沙发
postcam(未真实交易用户) 发表于 2014-6-19 13:31:29
[victory]
已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

藤椅
shortsale(未真实交易用户) 发表于 2014-6-19 14:47:44
  1. require(rjags)
  2. foo <- jags.model(file="regression.bug",
  3.                   data=forJags,
  4.                   inits=inits)
  5. out <- coda.samples(model=foo,
  6.                     variable.names=c("beta","sigma"),
  7.                     n.iter=50000,thin=5)
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

板凳
pensifia(未真实交易用户) 发表于 2014-6-19 15:13:17
  1. library(pscl)
  2. data(absentee)
  3. attach(absentee)
  4. ## create variables for regression analysis
  5. y <- (absdem - absrep)/(absdem + absrep)*100
  6. x <- (machdem - machrep)/(machdem + machrep)*100

  7. ## environment for passing to JAGS
  8. forJags <- list(y=y[1:20],x=x[1:20],n=20,xstar=x[21])

  9. ## initial values, one chain
  10. inits <- list(list(beta=c(0,0),sigma=5,
  11.                    .RNG.seed=1234,
  12.                    .RNG.name="base::MersenneTwister"))
复制代码

报纸
songlinjl(真实交易用户) 发表于 2014-6-19 17:12:16
  1. require(rjags)
  2. foo <- jags.model(file="negbin.bug",
  3.                   data=forJags,
  4.                   inits=inits)

  5. update(foo,5000)
  6.                   
  7. out <- coda.samples(foo,
  8.                     variable.names=c("beta","r"),
  9.                     n.iter=50000)
复制代码

地板
ashene(未真实交易用户) 发表于 2014-6-19 18:07:44
  1. require(pscl)
  2. data(bioChemists)

  3. forJags <- list(n=dim(bioChemists)[1],  ## sample size
  4.                 fem=as.numeric(bioChemists$fem=="Women"),    ## covariates
  5.                 mar=as.numeric(bioChemists$mar=="Married"),
  6.                 kid5=bioChemists$kid5,
  7.                 phd=bioChemists$phd,
  8.                 ment=bioChemists$ment,
  9.                 y=bioChemists$art,    ## response
  10.                 b0 = rep(0,6),        ## prior hyperparameters
  11.                 B0 = diag(.0001,6))

  12. inits <- list(list(beta=rep(0,6),
  13.                    r=1))
复制代码

7
Crsky7(未真实交易用户) 发表于 2014-6-19 20:30:49
  1. forJags <- list(y=y,
  2.                 x=x,
  3.                 b0=rep(0,7),
  4.                 B0=diag(.0001,7))

  5. inits <- list(list(beta=matrix(0,7,2),       ## two sets of initial values
  6.                    s=runif(n=2,0,.5),
  7.                    rho=runif(n=1,-1,1),
  8.                    nu=4),
  9.               list(beta=matrix(0,7,2),
  10.                    s=runif(n=2,0,.5),
  11.                    rho=runif(n=1,-1,1),
  12.                    nu=29))
  13. require(rjags)
  14. foo <- jags.model(file="92plain.bug",
  15.                   data=forJags,
  16.                   inits=inits,
  17.                   nchain=2,
  18.                   n.adapt=10e3)

  19. out <- coda.samples(foo,
  20.                     variable.names=c("beta","Sigma","nu"),
  21.                     n.iter=50e3)
复制代码

8
glacierr(真实交易用户) 发表于 2014-6-19 21:56:44
  1. ## map into space of identified parameters
  2. remap <- function(x){
  3.   foo <- x                         ## copy MCMC output
  4.   int <- x[,"beta[1,1]"]
  5.   k <- cbind(x[,"beta[4,1]"],      ## subset of parameters we need
  6.              x[,"beta[5,1]"],
  7.              x[,"beta[6,1]"],
  8.              x[,"beta[7,1]"])
  9.   kbar <- apply(k,1,mean)          ## mean at each iteration
  10.   k <- sweep(k,1,kbar)             ## subtract out
  11.   foo[,"beta[1,1]"]  <- int + kbar
  12.   foo[,"beta[4,1]"] <- k[,1]       ## write mean-differenced to output
  13.   foo[,"beta[5,1]"] <- k[,2]
  14.   foo[,"beta[6,1]"] <- k[,3]
  15.   foo[,"beta[7,1]"] <- k[,4]

  16.   int <- x[,"beta[2,1]"]
  17.   k <- cbind(x[,"beta[4,2]"],      ## repeat for 2nd set of regression coefficients
  18.              x[,"beta[5,2]"],
  19.              x[,"beta[6,2]"],
  20.              x[,"beta[7,2]"])
  21.   kbar <- apply(k,1,mean)
  22.   k <- sweep(k,1,kbar)
  23.   foo[,"beta[1,2]"] <- int + kbar
  24.   foo[,"beta[4,2]"] <- k[,1]
  25.   foo[,"beta[5,2]"] <- k[,2]
  26.   foo[,"beta[6,2]"] <- k[,3]
  27.   foo[,"beta[7,2]"] <- k[,4]

  28.   return(foo)
  29. }

  30. z <- lapply(out,remap)             ## apply to each chain in out
复制代码

9
Lisrelchen(未真实交易用户) 发表于 2014-6-26 22:21:23
  1. inits <- list(list(sigma1=3,sigma2=3,rho=.99),
  2.               list(sigma1=.25,sigma2=.25,rho=-.99))
  3. foo <- jags.model(file="bimodal3.bug",
  4.                   data=forJags,
  5.                   n.adapt=5000,
  6.                   nchain=2,
  7.                   inits=inits)

  8. out <- coda.samples(foo,
  9.                     n.iter=250000,
  10.                     thin=50,
  11.                     variable.names=c("Sigma","rho"))
复制代码
  1. model{
  2.   for (i in 1:12){
  3.     y[i,1] ~ dnorm(0.0,tau[1,1]);  ## y1 marginal model
  4.     y[i,2] ~ dnorm(mu[i],tau21);   ## y2 conditional on y1
  5.     mu[i] <- beta*y[i,1];          ## E(y2|y1)
  6.   }

  7.   ## priors  
  8.   sigma[1] ~ dunif(0,6)
  9.   sigma[2] ~ dunif(0,6)
  10.   rho ~ dunif(-1,1)                   ## correlation
  11.   Sigma[1,1] <- pow(sigma[1],2)       ## variance
  12.   Sigma[2,2] <- pow(sigma[2],2)       ## variance
  13.   Sigma[1,2] <- rho*sigma[1]*sigma[2] ## covariance        
  14.   Sigma[2,1] <- Sigma[1,2]            ## covariance

  15.   ## convert covariance matrix to precision matrix
  16.   tau <- inverse(Sigma)

  17.   ## conditional variance
  18.   Sigma21 <- Sigma[2,2] - pow(Sigma[1,2],2)/Sigma[1,1]
  19.   tau21 <- 1/Sigma21                  ## conditional precision
  20.   
  21.   beta <- Sigma[1,2]/Sigma[1,1]       ## regression coefficient
  22. }
复制代码

10
lenore2005(未真实交易用户) 发表于 2014-6-26 22:34:53
  1. y <- matrix(c(-1, -1, 1, 1, 2, -2, 2, -2, NA, NA, NA, NA,
  2.               -1, 1, -1, 1, NA, NA, NA, NA, 2, -2, 2, -2),
  3.             12, 2)
  4. forJags <- list(y=y)
复制代码

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-5 14:08