Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Dec 5, 2023
1 parent 386a621 commit d3435a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions demos_rstan/brms_demo.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ mcmc_hist(draws, pars='theta') +
#' probability. Visualize the prior by drawing samples from it
prior_mean <- 0
prior_sd <- 1
prior_intercept <- normal(location = prior_mean, scale = prior_sd)
prior_samples <- data.frame(
prior_draws <- data.frame(
theta = plogis(rnorm(20000, prior_mean, prior_sd)))
mcmc_hist(prior_samples) +
mcmc_hist(prior_draws) +
xlim(c(0,1))

#+ results='hide'
Expand Down Expand Up @@ -133,9 +132,8 @@ mcmc_hist(draws, pars='theta') +
#' Visualize the prior by drawing samples from it
prior_mean <- 0
prior_sd <- 1
prior_samples <- data.frame(
theta = plogis(rnorm(20000, prior_mean, prior_sd)))
mcmc_hist(prior_samples)
prior_draws <- data.frame(theta = plogis(rnorm(20000, prior_mean, prior_sd)))
mcmc_hist(prior_draw)

#' Binomial model with the same data
data_bin <- data.frame(N = c(10), y = c(7))
Expand Down
10 changes: 4 additions & 6 deletions demos_rstan/brms_demo.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ probability. Visualize the prior by drawing samples from it
```{r}
prior_mean <- 0
prior_sd <- 1
prior_intercept <- normal(location = prior_mean, scale = prior_sd)
prior_samples <- data.frame(
prior_draws <- data.frame(
theta = plogis(rnorm(20000, prior_mean, prior_sd)))
mcmc_hist(prior_samples) +
mcmc_hist(prior_draws) +
xlim(c(0,1))
```
Expand Down Expand Up @@ -181,9 +180,8 @@ Visualize the prior by drawing samples from it
```{r}
prior_mean <- 0
prior_sd <- 1
prior_samples <- data.frame(
theta = plogis(rnorm(20000, prior_mean, prior_sd)))
mcmc_hist(prior_samples)
prior_draws <- data.frame(theta = plogis(rnorm(20000, prior_mean, prior_sd)))
mcmc_hist(prior_draw)
```

Binomial model with the same data
Expand Down

0 comments on commit d3435a8

Please sign in to comment.