Models
MCMC
Bayesian Regression
Bayes Formula
Posterior Prediction
100

In the Gamma-Poisson model, this is what the parameter λ represents.

What is the average rate of events per unit of time (or space)?

100

In an ideal MCMC chain, the autocorrelation between two successive samples is high, but does this as the distance between samples increases.

What is quickly decreases toward 0?

100

In a Bayesian regression model Y = β₀ + β₁X + ε, this parameter represents the expected change in Y for a one-unit increase in X.

What is β₁ (the slope)?

100

In Bayes' rule, this term represents how likely the observed data are under a given parameter value.

What is the likelihood?

100

This distribution is used to predict a new, unobserved data point by averaging over all possible parameter values weighted by the posterior.

What is the posterior predictive distribution?

200

A sociologist records whether each of 500 survey respondents voted in the last election (yes or no). Name the appropriate model and state what parameter we are estimating.

What is the beta-binomial model? We are estimating pi, the true probability of voting.

200

A trace plot shows a chain that drifts steadily upward over 2,000 iterations instead of bouncing around a stable region. Name the problem and what it suggests about the model.

The chain has not converged. It suggests the chain has not reached the target posterior distribution.

200

A posterior summary shows β₁ has a median of −2.1 with a 95% credible interval of [−4.3, −0.2]. In one sentence, interpret this in the context of predicting plant growth (Y) from pollution level (X).

There is a 95% probability that each one-unit increase in pollution level is associated with a decrease in plant growth of between 0.2 and 4.3 units.

200

A prior is Beta(2, 8). Without any data, what is the prior mean and what does it tell us about the researcher's belief?

Prior mean = 2/(2+8) = 0.20. The researcher believes the probability of success is around 20% before seeing any data.

200

A posterior predictive distribution has a mean of 50 and standard deviation of 12. What does the standard deviation represent in this context?

It represents the total uncertainty in predicting a new observation, combining both our uncertainty about the true mean µ and the natural variability σ in the data.

300

A Gamma(3, 1) prior is placed on λ. After observing counts of 2, 5, 4, and 7 over four weeks, state the posterior distribution.

What is Gamma(3+18, 1+4) = Gamma(21, 5)?

300

In the Metropolis algorithm, your current state is θ = 0.7 with posterior density 0.30. You propose θ* = 0.9 with posterior density 0.45. What is the probability of accepting the proposed jump?

α = min(1, 0.45/0.30) = min(1, 1.5) = 1.0. There is a 100% chance of accepting the proposed jump.

300

A centered regression model has posterior medians β₀_c = 55, β₁ = 3.0. The mean of X is 4. Calculate the predicted Y for X = 7 and for X = 4.

For X = 7: ŷ = 55 + 3.0×(7−4) = 55 + 9 = 64. For X = 4 (the mean): ŷ = 55 + 3.0×(0) = 55.

300

Write out Bayes' rule in proportional form and name each component.

posterior ∝ likelihood × prior, or f(π|y) ∝ L(π|y) · f(π)

300

A researcher has 10,000 posterior predictive draws for a new observation with a mean of 55 and finds that 800 draws fall below 70. What is the estimated probability that a new observation exceeds 70?

P(y_new > 70) ≈ 1- 800/10000 = 92% 

400

A psychologist believes the average reaction time is around 250ms but is quite uncertain. Write an appropriate Normal prior for µ and explain your reasoning.

What is µ ~ Normal(250, 50)? The mean of 250 reflects the researcher's prior belief, and a standard deviation of 50 allows for a wide range of plausible values given the uncertainty. 

400

A researcher runs the Stan model from $400 but suspects the chains are not well-mixed. Name three things they could do to improve mixing.

What is (1) Increase the number of iterations, (2) increase the warm-up period, (3) tune the prior distributions to be more informative?

400

A researcher fits a Bayesian regression and gets a 95% credible interval for β₁ of [−0.5, 3.2]. Can they conclude there is a positive relationship between X and Y?

No — because the interval includes 0, we cannot conclude with 95% certainty that the relationship is positive. The true slope could be negative, zero, or positive.

400

Your prior is Beta(1, 1) and you observe 8 successes in 10 trials. A colleague uses a Beta(5, 5) prior and observes the same data. Calculate both posteriors and their means and explain the difference.

Posterior 1: Beta(9, 3), mean = 0.75. Posterior 2: Beta(13, 7), mean = 0.65. The colleague's posterior is closer to 0.5 because Beta(5,5) is a stronger prior centered at 0.5.

400

A researcher uses their model to generate 10,000 posterior predictive draws for a new observation and constructs a 95% credible interval of [42, 88]. Interpret this interval in plain language.

There is a 95% probability that the next new observation will fall between 42 and 88.

500

A public health researcher believes that roughly 30% of adults in a small town get the flu each winter, but is fairly uncertain. She surveys 20 residents and finds 12 had the flu last winter. Write R code to compute the posterior mean and state the posterior distribution.  

What is 0.5 and Beta(15, 15)?

500

Using the built-in mtcars dataset, write Stan code to estimate the average mpg µ, run 4 chains for 8,000 iterations, then produce a trace plot and comment on whether the chains are well-mixed.

What is 

mpg_model <- "  data {    int<lower = 0> n;    vector[n] y;  }  parameters {    real mu;    real<lower = 0> sigma;  }  model {    y ~ normal(mu, sigma);    mu ~ normal(20, 5);    sigma ~ exponential(1);  } " mpg_sim <- stan(model_code = mpg_model,                 data = list(n = nrow(mtcars), y = mtcars$mpg),                chains = 4, iter = 8000, seed = 84735) mcmc_trace(mpg_sim, pars = "mu") 

The chains are well mixed!

500

Using the built-in trees dataset, fit a centered Bayesian regression of Volume on Height using stan_glm with a Normal(30, 10) prior on the intercept, Normal(1, 0.5) prior on the slope, and Exponential(1) prior on σ. Then produce a tidy posterior summary and interpret the 95% credible interval for the slope in context.

There is a 95% probability that for each one-foot increase in tree height, volume increases by between 0.83 and 1.96 cubic feet.

500

Write code to plot a Beta(3, 7) prior, summarize it numerically, and update it with 12 successes in 20 trials and plot the resulting prior, likelihood, and posterior together. Show us what you got!

Code?

500

A researcher generates 10,000 posterior predictive draws for a new observation. 320 fall below 20 and 450 fall above 80. What is the estimated probability that a new observation falls between 20 and 80? Show your work.

P(20 < y_new < 80) = 1 − (320/10000) − (450/10000) = 1 − 0.032 − 0.045 = 0.923 or 92.3%.

M
e
n
u