Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Feb 1, 2017
1 parent 4c3b209 commit 582d38e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions demos_ch2/demo2_1.R
Expand Up @@ -2,6 +2,7 @@
# Aki Vehtari <Aki.Vehtari@aalto.fi>
# Markus Paasiniemi <Markus.Paasiniemi@aalto.fi>

# Probability of a girl birth given placenta previa (BDA3 p. 37).
# 437 girls and 543 boys have been observed. Calculate and plot the
# posterior distribution of the proportion of girls theta, using
# uniform prior on theta
Expand Down
1 change: 1 addition & 0 deletions demos_ch2/demo2_2.R
Expand Up @@ -2,6 +2,7 @@
# Aki Vehtari <Aki.Vehtari@aalto.fi>
# Markus Paasiniemi <Markus.Paasiniemi@aalto.fi>

# Probability of a girl birth given placenta previa (BDA3 p. 37).
# Illustrate the effect of prior.
# Comparison of posterior distributions with different
# parameter values for the beta prior distribution.
Expand Down
1 change: 1 addition & 0 deletions demos_ch2/demo2_3.R
Expand Up @@ -2,6 +2,7 @@
# Aki Vehtari <Aki.Vehtari@aalto.fi>
# Markus Paasiniemi <Markus.Paasiniemi@aalto.fi>

# Probability of a girl birth given placenta previa (BDA3 p. 37).
# Simulate samples from Beta(438,544), draw a histogram with
# quantiles, and do the same for a transformed variable.

Expand Down
2 changes: 1 addition & 1 deletion demos_ch2/demo2_4.R
Expand Up @@ -2,6 +2,7 @@
# Aki Vehtari <Aki.Vehtari@aalto.fi>
# Markus Paasiniemi <Markus.Paasiniemi@aalto.fi>

# Probability of a girl birth given placenta previa (BDA3 p. 37).
# Calculate the posterior distribution on a discrete grid of points by
# multiplying the likelihood and a non-conjugate prior at each point,
# and normalizing over the points. Simulate samples from the resulting
Expand Down Expand Up @@ -92,4 +93,3 @@ p3 <- ggplot() +

# combine the plots
grid.arrange(p1, p2, p3)

4 changes: 4 additions & 0 deletions demos_ch3/demo3_1_4.R
Expand Up @@ -2,6 +2,10 @@
# Aki Vehtari <Aki.Vehtari@aalto.fi>
# Markus Paasiniemi <Markus.Paasiniemi@aalto.fi>

# Examples and illustrations for a normal model with unknown mean and
# variance (BDA3 section 3.2 on p. 64).
# Multivariate joint distribution, conditional distribution, marginal
# distribution, marginalization and posterior predictive distribution
# R versions of demos 3_1-3_4 combined into one demo
# like iPython notebook versions

Expand Down
1 change: 1 addition & 0 deletions demos_ch3/demo3_5.R
Expand Up @@ -2,6 +2,7 @@
# Aki Vehtari <Aki.Vehtari@aalto.fi>
# Markus Paasiniemi <Markus.Paasiniemi@aalto.fi>

# Estimating the speed of light using normal model BDA3 p. 66
library(ggplot2)
library(gridExtra)
library(tidyr)
Expand Down

0 comments on commit 582d38e

Please sign in to comment.