Skip to content

Commit bb92bfb

Browse files
committed
overlaying histogram update
1 parent 70cdf5d commit bb92bfb

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

vignettes/Chapter07.Rmd

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -794,20 +794,21 @@ if (pdfplots) {
794794
par(mfrow = c(1, 1), mar = c(2.5, 2.5, 1.5, .1), mgp = c(1.5, .5, 0), lwd = 1.5)
795795
mybreaks <- seq(floor(100 * min(stationary1$phi, stationary2$phi)) / 100,
796796
ceiling(100 * max(ar1draws)) / 100,
797-
by = .005)
798-
hist(stationary2$phi, breaks = mybreaks, col = rgb(1, 1, 0, .2),
799-
main = "Histogram of posterior draws", xlab = expression(phi),
800-
freq = FALSE, ylab = "")
797+
by = .0025)
798+
hist(stationary2$phi, breaks = mybreaks, col = rgb(1, 1, 0, .3),
799+
main = "Histograms of posterior draws", xlab = expression(phi),
800+
freq = FALSE, ylab = "", border = NA)
801801
hist(stationary1$phi, breaks = mybreaks, col = rgb(1, 0, 0, .2),
802-
freq = FALSE, add = TRUE)
803-
hist(ar1draws[!nonstationary[, 1]], breaks = mybreaks, col = rgb(0, 0, 1, .2),
804-
freq = FALSE, add = TRUE)
802+
freq = FALSE, add = TRUE, border = NA)
803+
hist(ar1draws[!nonstationary[, 1]], breaks = mybreaks, col = rgb(0, 0, 1, .15),
804+
freq = FALSE, add = TRUE, border = NA)
805805
hist(ar1draws, breaks = mybreaks, col = rgb(0, 1, 0, .2),
806-
freq = FALSE, add = TRUE)
806+
freq = FALSE, add = TRUE, border = NA)
807807
legend("topright",
808808
c("Unrestricted posterior", "Post-processed posterior",
809809
"Beta prior posterior (flat)", "Beta prior posterior (shrunken)"),
810-
fill = rgb(c(0, 0, 1, 1), c(1, 0, 0, 1), c(0, 1, 0, 0), .2))
810+
fill = rgb(c(0, 0, 1, 1), c(1, 0, 0, 1), c(0, 1, 0, 0),
811+
c(.2, .15, .2, .3)), border = NA)
811812
```
812813

813814
## Section 7.2.5: Evaluating the Efficiency of an MCMC Sampler

0 commit comments

Comments
 (0)