Applied Bayesian Data Analysis - Statistical Horizons

Click here to load reader

  • date post

    08-Dec-2021
  • Category

    Documents

  • view

    0
  • download

    0

Embed Size (px)

Transcript of Applied Bayesian Data Analysis - Statistical Horizons

Introduction to Bayesian Statistical ModelingRegression
Multiple xs, y for each of n subjects
• y = (y1, y2, y3,…, yn)
• x = (x1, x2, x3,…, xn)
• xi = (xi1, xi2,…, xiJ)
yi = β0 + β1xi1 + … + βJxiJ + εi εi independent, ~ N(0, σε 2)
yi | xi, β0, β1,…, βJ, σε 2 ~ N(β0 + β1xi1 +…+ βJxiJ, σε
2)
yi = β0 + β′xi + εi εi independent, ~ N(0, σε 2), β = (β1,…, βJ)
yi | xi, β, σε 2 ~ N(β0 + β′xi, σε
2)
Regression
Regression 30
Posterior Distribution
p(β0, β, σε | y, x) p(y | β0, β, σε, x) p(β0, β, σε)
Regression
31
Conditional Probability of the Data
p(β0, β1, σε | y, x) p(y | β0, β, σε, x) p(β0, β, σε)
Assuming exchangeability of subjects
p(y | β0, β, σε, x) = Πi p(yi | β0, β, σε, xi)
Assuming conditional normality
yi | β0, β, σε, xi ~ N(β0 + β1xi1 + … + βJxiJ, σε 2)
Regression
Multivariate
prior?
0 0
Regression 36
0 0
1 1 2 2
N N N =
0 0
1 1 2 2
N N N =
Regression 38
0 0
Regression
39
Regression 40
Posterior Distribution
p(β0, β, σε | y, x) p(y | β0, β, σε, x) p(β0, β, σε)
Πi N(β0 + β1xi1 + … + βJxiJ, σε 2)
j = 1,…, J
• Regress Chapter 3 on Chapter 1 and Chapter 2
Test # items Range Mean
Correlation Chapter 1 Chapter 2
Chapter 2 0.58
Regression 43
Posterior Distribution
p(β0, β, σε | y, x) p(y | β0, β, σε, x) p(β0, β, σε)
Πi N(β0 + β1xi1 + β2xi2, σε 2)
j = 1, 2
44
Ch3Testi | Ch1Testi, β0, β1, β2, σε ~ N(β0 + β1Ch1Testi, + β2Ch2Testi, σε 2)
fitted.model <- stan_glm(
βj ~ N(0, 900) = N(0, 302) for j = 1, 2
σε ~ Exp(1)
fitted.model <- stan_glm(
prior_aux = exponential(1, autoscale =
in Stan via rstanarm.R’
Regression 47
Convergence of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Regression 48
Convergence of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Regression 49
Convergence of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Regression 50
Convergence of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Regression 51
Convergence of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Regression 52
Summary of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Regression 53
Summary of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Regression 54
Summary of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Mean SD
95% HPD
Regression 55
Summary of 4 Chains for 5,000 Iterations After 1,000 Iterations of Warmup
Mean SD
95% HPD
Regression 56
Write Up
analysis, specifying the outcome as
yi | β0, β, σε, xi ~ N(β0 + β1xi1 + β2xi2, σε 2) i = 1,…, n
and employed diffuse prior distributions
β0 ~ N(0, 900); βj ~ N(0, 900) j = 1, 2; σε ~ Exponential(1).
4 chains were run for 5,000 iterations following a warmup period
of 1,000 iterations. Inspection of the trace plots and the PSRF ( )
evidenced convergence. The marginal posterior distributions for
the parameters are depicted in Figure xxxx and summarized in
Table xxxx….
Bayesian Analysis
Regression 58
Frequentist Analysis of
R2 0.60 0.59 0.08 (0.43, 0.73)
Numerically similar, conceptually different
Results for β0 troublesome