Download presentation
Presentation is loading. Please wait.
Published byÁlvaro Rivero Peralta Modified over 6 years ago
1
Bayesian Hierarchical Model: Many Theta's in Multiple Conditions
Lecture was not given on Monday 2/6/2017 because of UW closure due to snow. A lecture that is largely the same as the present one will be given as lec06-2.p548.w17.pptm on Wednesday 2/8/2017. Bayesian Hierarchical Model: Many Theta's in Multiple Conditions P548: Bayesian Stats with Psych Applications Instructor: John Miyamoto 02/06/2017: Lecture 06-1 Note: This Powerpoint presentation may contain macros that I wrote to help me create the slides. The macros aren’t needed to view the slides. You can disable or delete the macros without any change to the presentation.
2
Figure 8.2: Bayesian Model for Flips of a Single Coin
q X N q ~ beta(1, 1) X ~ binomial(q, N) Kruschke, Fig. 8.2, p. 196 LW, Fig. 2.1, p. 18 Psych 548:, Miyamoto, Win ‘16
3
Figure 9.7: J coins sampled from the same mint
k w a b qs yij s = 1, ..., J i = 1, ..., n Amu and Bmu are not represented as random variables in the diagram on the right because they are treated as constants in this model. They are not sampled from a hyperhyperdistribution. Skappa & Rkappa are not represented as random variables in the diagram on the right because they are treated as constants in this model. Specifically, Skappa = pow(10,2)/pow(10,2) = 1, Rkappa = 10/pow(10,2). Note that kappa is a random variable that is sampled from a gamma( Skappa, Rkappa ) distribution. Kruschke Fig. 9.7 UW Psych 548, Miyamoto, Spr '12
4
Figure 9.13 (ed.2): J coins sampled from C mints
w k A B c = 1, 2, 3 wc kc Amu and Bmu are not represented as random variables in the diagram on the right because they are treated as constants in this model. They are not sampled from a hyperhyperdistribution. Skappa & Rkappa are not represented as random variables in the diagram on the right because they are treated as constants in this model. Specifically, Skappa = pow(10,2)/pow(10,2) = 1, Rkappa = 10/pow(10,2). Note that kappa is a random variable that is sampled from a gamma( Skappa, Rkappa ) distribution. ac bc s = 1, ..., J qs i = 1, ..., n yij Kruschke Fig p. 252 UW Psych 548, Miyamoto, Spr '12
5
Simplified Version, LW Notation. Figure 9. 13 (ed
Simplified Version, LW Notation. Figure 9.13 (ed.2): J coins sampled from N mints w k w k A B c = 1, 2, 3 c = 1, 2, 3 wc kc wc kc Amu and Bmu are not represented as random variables in the diagram on the right because they are treated as constants in this model. They are not sampled from a hyperhyperdistribution. Skappa & Rkappa are not represented as random variables in the diagram on the right because they are treated as constants in this model. Specifically, Skappa = pow(10,2)/pow(10,2) = 1, Rkappa = 10/pow(10,2). Note that kappa is a random variable that is sampled from a gamma( Skappa, Rkappa ) distribution. s = 1, ..., J ac bc qs s = 1, ..., J qs i = 1, ..., n yij i = 1, ..., n yij UW Psych 548, Miyamoto, Spr '12
6
Correspondence Between Model Syntax & Graphical Model
# Hyperpriors for omega0 and kappa0, the parameters of # the hyperdistribution from which omega[cc] and kappa[cc] # are sampled. omegaO ~ dbeta( 1.0, 1.0 ) kappaO <- kappaMinusTwoO + 2 kappaMinusTwoO ~ dgamma( 0.01, 0.01 ) # Compute the A0 and B0 parameters of the hyper beta distribution A0 <- omegaO*(kappaO - 2) + 1 B0 <- (1 - omegaO)*(kappaO - 2) + 1 # Hyperprior for omega[cc] and kappa[cc], # the condition-specific omega and kappa for ( mm in 1:Ncat ) { omega[mm] ~ dbeta( A0, B0 ) kappaMinusTwo[mm] ~ dgamma( 0.01, 0.01 ) kappa[mm] <- kappaMinusTwo[mm] + 2 } # Prior for theta[j] for ( j in 1:Nsubj ) { aSubj[j] <- omega[p[j]]*(kappa[p[j]]-2)+1 bSubj[j] <- (1-omega[p[j]])*(kappa[p[j]]-2)+1 theta[j] ~ dbeta( aSubj[j], bSubj[j] ) # Likelihood function for ( i in 1:Nsubj ) { z[i] ~ dbin( theta[i], N[i] ) } #close bracket for the model syntax w k A B c = 1, 2, 3 wc kc Amu and Bmu are not represented as random variables in the diagram on the right because they are treated as constants in this model. They are not sampled from a hyperhyperdistribution. Skappa & Rkappa are not represented as random variables in the diagram on the right because they are treated as constants in this model. Specifically, Skappa = pow(10,2)/pow(10,2) = 1, Rkappa = 10/pow(10,2). Note that kappa is a random variable that is sampled from a gamma( Skappa, Rkappa ) distribution. ac bc s = 1, ..., J qs i = 1, ..., n yij UW Psych 548, Miyamoto, Spr '12
7
Set Up for Instructor Turn off your cell phone. Close web browsers if they are not needed. Classroom Support Services (CSS), 35 Kane Hall, If the display is odd, try setting your resolution to 1024 by 768 Run Powerpoint. For most reliable start up: Start laptop & projector before connecting them together If necessary, reboot the laptop Psych 548, Miyamoto, Aut ‘16
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.