Skip to content

Commit 70c0d83

Browse files
committed
weights added to conjugate regression analysis
1 parent df2e20c commit 70c0d83

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

vignettes/Chapter06.Rmd

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ knitr::kable(round(cbind(qt(0.025,df=2*cN)*post.sd+beta.hat, beta.hat,
8383
We can also plot the marginal posterior distributions.
8484
```{r}
8585
if (pdfplots) {
86-
pdf("6-4_1.pdf", width = 8, height = 5)
86+
pdf("6-4_1.pdf", width = 8, height = 4)
8787
par(mar = c(2.5, 1.5, 1.5, .1), mgp = c(1.6, .6, 0))
8888
}
8989
par(mfrow = c(1, 3))
@@ -122,7 +122,7 @@ knitr::kable(round(cbind(qt(0.025,df=2*cN)*post.sd.conj+bN.conj, bN.conj,
122122
col.names=c("2.5 quantile","posterior mean","97.5 quantile"))
123123
124124
```
125-
We plot the marginal posteriors together with those under the improper prior.
125+
We plot the marginal posteriors (in blue) together with those under the improper prior.
126126
```{r}
127127
if (pdfplots) {
128128
pdf("6-4_2.pdf", width = 8, height = 5)
@@ -138,9 +138,14 @@ for (i in seq_len(nrow(beta.hat))) {
138138
add=TRUE, col="blue")
139139
}
140140
```
141+
Compared to the improper prior we see shrinkage to zero under the conjugate prior.
141142

142143

144+
```{r}
145+
W=BN.conj%*%B0.inv.conj
146+
print(round(W,3))
143147
148+
```
144149
## Figure 6.1
145150
We start with a visualization of the normal and the horseshoe prior.
146151

0 commit comments

Comments
 (0)