🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 147 (from laksa068)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

đź“„
INDEXABLE
âś…
CRAWLED
16 hours ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://www.bayesrulesbook.com/
Last Crawled2026-04-23 07:36:38 (16 hours ago)
First Indexed2020-10-07 22:13:58 (5 years ago)
HTTP Status Code200
Content
Meta TitleBayes Rules! An Introduction to Applied Bayesian Modeling
Meta DescriptionAn introduction to applied Bayesian modeling.
Meta Canonicalnull
Boilerpipe Text
News Foreword Preface Audience Navigating this book Getting set up Accessibility and inclusion Contact us Acknowledgments License About the Authors I Bayesian Foundations 1 The Big (Bayesian) Picture 1.1 Thinking like a Bayesian 1.1.1 Quiz yourself 1.1.2 The meaning of probability 1.1.3 The Bayesian balancing act 1.1.4 Asking questions 1.2 A quick history lesson 1.3 A look ahead 1.3.1 Unit 1: Bayesian foundations 1.3.2 Unit 2: Posterior simulation & analysis 1.3.3 Unit 3: Bayesian regression & classification 1.3.4 Unit 4: Hierarchical Bayesian models 1.4 Chapter summary 1.5 Exercises 2 Bayes’ Rule 2.1 Building a Bayesian model for events 2.1.1 Prior probability model 2.1.2 Conditional probability & likelihood 2.1.3 Normalizing constants 2.1.4 Posterior probability model via Bayes’ Rule! 2.1.5 Posterior simulation 2.2 Example: Pop vs soda vs coke 2.3 Building a Bayesian model for random variables 2.3.1 Prior probability model 2.3.2 The Binomial data model 2.3.3 The Binomial likelihood function 2.3.4 Normalizing constant 2.3.5 Posterior probability model 2.3.6 Posterior shortcut 2.3.7 Posterior simulation 2.4 Chapter summary 2.5 Exercises 2.5.1 Building up to Bayes’ Rule 2.5.2 Practice Bayes’ Rule for events 2.5.3 Practice Bayes’ Rule for random variables 2.5.4 Simulation exercises 3 The Beta-Binomial Bayesian Model 3.1 The Beta prior model 3.1.1 Beta foundations 3.1.2 Tuning the Beta prior 3.2 The Binomial data model & likelihood function 3.3 The Beta posterior model 3.4 The Beta-Binomial model 3.5 Simulating the Beta-Binomial 3.6 Example: Milgram’s behavioral study of obedience 3.6.1 A Bayesian analysis 3.6.2 The role of ethics in statistics and data science 3.7 Chapter summary 3.8 Exercises 3.8.1 Practice: Beta prior models 3.8.2 Practice: Beta-Binomial models 4 Balance and Sequentiality in Bayesian Analyses 4.1 Different priors, different posteriors 4.2 Different data, different posteriors 4.3 Striking a balance between the prior & data 4.3.1 Connecting observations to concepts 4.3.2 Connecting concepts to theory 4.4 Sequential analysis: Evolving with data 4.5 Proving data order invariance 4.6 Don’t be stubborn 4.7 A note on subjectivity 4.8 Chapter summary 4.9 Exercises 4.9.1 Review exercises 4.9.2 Practice: Different priors, different posteriors 4.9.3 Practice: Balancing the data & prior 4.9.4 Practice: Sequentiality 5 Conjugate Families 5.1 Revisiting choice of prior 5.2 Gamma-Poisson conjugate family 5.2.1 The Poisson data model 5.2.2 Potential priors 5.2.3 Gamma prior 5.2.4 Gamma-Poisson conjugacy 5.3 Normal-Normal conjugate family 5.3.1 The Normal data model 5.3.2 Normal prior 5.3.3 Normal-Normal conjugacy 5.3.4 Optional: Proving Normal-Normal conjugacy 5.4 Why no simulation in this chapter? 5.5 Critiques of conjugate family models 5.6 Chapter summary 5.7 Exercises 5.7.1 Practice: Gamma-Poisson 5.7.2 Practice: Normal-Normal 5.7.3 General practice exercises II Posterior Simulation & Analysis 6 Approximating the Posterior 6.1 Grid approximation 6.1.1 A Beta-Binomial example 6.1.2 A Gamma-Poisson example 6.1.3 Limitations 6.2 Markov chains via rstan 6.2.1 A Beta-Binomial example 6.2.2 A Gamma-Poisson example 6.3 Markov chain diagnostics 6.3.1 Examining trace plots 6.3.2 Comparing parallel chains 6.3.3 Calculating effective sample size & autocorrelation 6.3.4 Calculating R-hat 6.4 Chapter summary 6.5 Exercises 6.5.1 Conceptual exercises 6.5.2 Practice: Grid approximation 6.5.3 Practice: MCMC 7 MCMC under the Hood 7.1 The big idea 7.2 The Metropolis-Hastings algorithm 7.3 Implementing the Metropolis-Hastings 7.4 Tuning the Metropolis-Hastings algorithm 7.5 A Beta-Binomial example 7.6 Why the algorithm works 7.7 Variations on the theme 7.8 Chapter summary 7.9 Exercises 7.9.1 Conceptual exercises 7.9.2 Practice: Normal-Normal simulation 7.9.3 Practice: Simulating more Bayesian models 8 Posterior Inference & Prediction 8.1 Posterior estimation 8.2 Posterior hypothesis testing 8.2.1 One-sided tests 8.2.2 Two-sided tests 8.3 Posterior prediction 8.4 Posterior analysis with MCMC 8.4.1 Posterior simulation 8.4.2 Posterior estimation & hypothesis testing 8.4.3 Posterior prediction 8.5 Bayesian benefits 8.6 Chapter summary 8.7 Exercises 8.7.1 Conceptual exercises 8.7.2 Practice exercises 8.7.3 Applied exercises III Bayesian Regression & Classification 9 Simple Normal Regression 9.1 Building the regression model 9.1.1 Specifying the data model 9.1.2 Specifying the priors 9.1.3 Putting it all together 9.2 Tuning prior models for regression parameters 9.3 Posterior simulation 9.3.1 Simulation via rstanarm 9.3.2 Optional: Simulation via rstan 9.4 Interpreting the posterior 9.5 Posterior prediction 9.5.1 Building a posterior predictive model 9.5.2 Posterior prediction with rstanarm 9.6 Sequential regression modeling 9.7 Using default rstanarm priors 9.8 You’re not done yet! 9.9 Chapter summary 9.10 Exercises 9.10.1 Conceptual exercises 9.10.2 Applied exercises 10 Evaluating Regression Models 10.1 Is the model fair? 10.2 How wrong is the model? 10.2.1 Checking the model assumptions 10.2.2 Dealing with wrong models 10.3 How accurate are the posterior predictive models? 10.3.1 Posterior predictive summaries 10.3.2 Cross-validation 10.3.3 Expected log-predictive density 10.3.4 Improving posterior predictive accuracy 10.4 How good is the MCMC simulation vs how good is the model? 10.5 Chapter summary 10.6 Exercises 10.6.1 Conceptual exercises 10.6.2 Applied exercises 10.6.3 Open-ended exercises 11 Extending the Normal Regression Model 11.1 Utilizing a categorical predictor 11.1.1 Building the model 11.1.2 Simulating the posterior 11.2 Utilizing two predictors 11.2.1 Building the model 11.2.2 Understanding the priors 11.2.3 Simulating the posterior 11.2.4 Posterior prediction 11.3 Optional: Utilizing interaction terms 11.3.1 Building the model 11.3.2 Simulating the posterior 11.3.3 Do you need an interaction term? 11.4 Dreaming bigger: Utilizing more than 2 predictors! 11.5 Model evaluation & comparison 11.5.1 Evaluating predictive accuracy using visualizations 11.5.2 Evaluating predictive accuracy using cross-validation 11.5.3 Evaluating predictive accuracy using ELPD 11.5.4 The bias-variance trade-off 11.6 Chapter summary 11.7 Exercises 11.7.1 Conceptual exercises 11.7.2 Applied exercises 11.7.3 Open-ended exercises 12 Poisson & Negative Binomial Regression 12.1 Building the Poisson regression model 12.1.1 Specifying the data model 12.1.2 Specifying the priors 12.2 Simulating the posterior 12.3 Interpreting the posterior 12.4 Posterior prediction 12.5 Model evaluation 12.6 Negative Binomial regression for overdispersed counts 12.7 Generalized linear models: Building on the theme 12.8 Chapter summary 12.9 Exercises 12.9.1 Conceptual exercises 12.9.2 Applied exercises 13 Logistic Regression 13.1 Pause: Odds & probability 13.2 Building the logistic regression model 13.2.1 Specifying the data model 13.2.2 Specifying the priors 13.3 Simulating the posterior 13.4 Prediction & classification 13.5 Model evaluation 13.6 Extending the model 13.7 Chapter summary 13.8 Exercises 13.8.1 Conceptual exercises 13.8.2 Applied exercises 13.8.3 Open-ended exercises 14 Naive Bayes Classification 14.1 Classifying one penguin 14.1.1 One categorical predictor 14.1.2 One quantitative predictor 14.1.3 Two predictors 14.2 Implementing & evaluating naive Bayes classification 14.3 Naive Bayes vs logistic regression 14.4 Chapter summary 14.5 Exercises 14.5.1 Conceptual exercises 14.5.2 Applied exercises 14.5.3 Open-ended exercises IV Hierarchical Bayesian models 15 Hierarchical Models are Exciting 15.1 Complete pooling 15.2 No pooling 15.3 Hierarchical data 15.4 Partial pooling with hierarchical models 15.5 Chapter summary 15.6 Exercises 15.6.1 Conceptual exercises 15.6.2 Applied exercises 16 (Normal) Hierarchical Models without Predictors 16.1 Complete pooled model 16.2 No pooled model 16.3 Building the hierarchical model 16.3.1 The hierarchy 16.3.2 Another way to think about it 16.3.3 Within- vs between-group variability 16.4 Posterior analysis 16.4.1 Posterior simulation 16.4.2 Posterior analysis of global parameters 16.4.3 Posterior analysis of group-specific parameters 16.5 Posterior prediction 16.6 Shrinkage & the bias-variance trade-off 16.7 Not everything is hierarchical 16.8 Chapter summary 16.9 Exercises 16.9.1 Conceptual exercises 16.9.2 Applied exercises 17 (Normal) Hierarchical Models with Predictors 17.1 First steps: Complete pooling 17.2 Hierarchical model with varying intercepts 17.2.1 Model building 17.2.2 Another way to think about it 17.2.3 Tuning the prior 17.2.4 Posterior simulation & analysis 17.3 Hierarchical model with varying intercepts & slopes 17.3.1 Model building 17.3.2 Optional: The decomposition of covariance model 17.3.3 Posterior simulation & analysis 17.4 Model evaluation & selection 17.5 Posterior prediction 17.6 Details: Longitudinal data 17.7 Example: Danceability 17.8 Chapter summary 17.9 Exercises 17.9.1 Conceptual exercises 17.9.2 Applied exercises 17.9.3 Open-ended exercises 18 Non-Normal Hierarchical Regression & Classification 18.1 Hierarchical logistic regression 18.1.1 Model building & simulation 18.1.2 Posterior analysis 18.1.3 Posterior classification 18.1.4 Model evaluation 18.2 Hierarchical Poisson & Negative Binomial regression 18.2.1 Model building & simulation 18.2.2 Posterior analysis 18.2.3 Model evaluation 18.3 Chapter summary 18.4 Exercises 18.4.1 Applied & conceptual exercises 18.4.2 Open-ended exercises 19 Adding More Layers 19.1 Group-level predictors 19.1.1 A model using only individual-level predictors 19.1.2 Incorporating group-level predictors 19.1.3 Posterior simulation & global analysis 19.1.4 Posterior group-level analysis 19.1.5 We’re just scratching the surface! 19.2 Incorporating two (or more!) grouping variables 19.2.1 Data with two grouping variables 19.2.2 Building a model with two grouping variables 19.2.3 Simulating models with two grouping variables 19.2.4 Examining the group-specific parameters 19.2.5 We’re just scratching the surface! 19.3 Exercises 19.3.1 Conceptual exercises 19.3.2 Applied exercises 19.4 Goodbye! References Published with bookdown Bayes Rules! An Introduction to Applied Bayesian Modeling Alicia A. Johnson, Miles Q. Ott, Mine Dogucu 2021-12-01
Markdown
- [![](https://www.bayesrulesbook.com/chapters/figs/index/bayes-rules-hex.png)](https://www.bayesrulesbook.com/) - [News](https://www.bayesrulesbook.com/) - [Foreword](https://www.bayesrulesbook.com/foreword) - [Preface](https://www.bayesrulesbook.com/preface) - [Audience](https://www.bayesrulesbook.com/preface#audience) - [Navigating this book](https://www.bayesrulesbook.com/preface#navigating-this-book) - [Getting set up](https://www.bayesrulesbook.com/preface#setup) - [Accessibility and inclusion](https://www.bayesrulesbook.com/preface#accessibility-and-inclusion) - [Contact us](https://www.bayesrulesbook.com/preface#contact-us) - [Acknowledgments](https://www.bayesrulesbook.com/preface#acknowledgments) - [License](https://www.bayesrulesbook.com/preface#license) - [About the Authors](https://www.bayesrulesbook.com/about-the-authors) - **I Bayesian Foundations** - [**1** The Big (Bayesian) Picture](https://www.bayesrulesbook.com/chapter-1) - [**1\.1** Thinking like a Bayesian](https://www.bayesrulesbook.com/chapter-1#thinking-like-a-bayesian) - [**1\.1.1** Quiz yourself](https://www.bayesrulesbook.com/chapter-1#quiz-yourself-1) - [**1\.1.2** The meaning of probability](https://www.bayesrulesbook.com/chapter-1#bayes-v-freq-probability) - [**1\.1.3** The Bayesian balancing act](https://www.bayesrulesbook.com/chapter-1#the-bayesian-balancing-act) - [**1\.1.4** Asking questions](https://www.bayesrulesbook.com/chapter-1#asking-questions) - [**1\.2** A quick history lesson](https://www.bayesrulesbook.com/chapter-1#a-quick-history-lesson) - [**1\.3** A look ahead](https://www.bayesrulesbook.com/chapter-1#a-look-ahead) - [**1\.3.1** Unit 1: Bayesian foundations](https://www.bayesrulesbook.com/chapter-1#ch1-unit-1) - [**1\.3.2** Unit 2: Posterior simulation & analysis](https://www.bayesrulesbook.com/chapter-1#unit-2-posterior-simulation-analysis) - [**1\.3.3** Unit 3: Bayesian regression & classification](https://www.bayesrulesbook.com/chapter-1#unit-3-bayesian-regression-classification) - [**1\.3.4** Unit 4: Hierarchical Bayesian models](https://www.bayesrulesbook.com/chapter-1#unit-4-hierarchical-bayesian-models) - [**1\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-1#chapter-summary) - [**1\.5** Exercises](https://www.bayesrulesbook.com/chapter-1#exercises) - [**2** Bayes’ Rule](https://www.bayesrulesbook.com/chapter-2) - [**2\.1** Building a Bayesian model for events](https://www.bayesrulesbook.com/chapter-2#building-a-bayesian-model-for-events) - [**2\.1.1** Prior probability model](https://www.bayesrulesbook.com/chapter-2#prior-probability-model) - [**2\.1.2** Conditional probability & likelihood](https://www.bayesrulesbook.com/chapter-2#conditional-probability-likelihood) - [**2\.1.3** Normalizing constants](https://www.bayesrulesbook.com/chapter-2#normalizing-constants) - [**2\.1.4** Posterior probability model via Bayes’ Rule\!](https://www.bayesrulesbook.com/chapter-2#posterior-probability-model-via-bayes-rule) - [**2\.1.5** Posterior simulation](https://www.bayesrulesbook.com/chapter-2#posterior-simulation) - [**2\.2** Example: Pop vs soda vs coke](https://www.bayesrulesbook.com/chapter-2#michelle-simple) - [**2\.3** Building a Bayesian model for random variables](https://www.bayesrulesbook.com/chapter-2#cousin-cole) - [**2\.3.1** Prior probability model](https://www.bayesrulesbook.com/chapter-2#prior-probability-model-1) - [**2\.3.2** The Binomial data model](https://www.bayesrulesbook.com/chapter-2#chapter-2-binomial-likelihood) - [**2\.3.3** The Binomial likelihood function](https://www.bayesrulesbook.com/chapter-2#the-binomial-likelihood-function) - [**2\.3.4** Normalizing constant](https://www.bayesrulesbook.com/chapter-2#normalizing-constant) - [**2\.3.5** Posterior probability model](https://www.bayesrulesbook.com/chapter-2#posterior-probability-model) - [**2\.3.6** Posterior shortcut](https://www.bayesrulesbook.com/chapter-2#shortcut-2) - [**2\.3.7** Posterior simulation](https://www.bayesrulesbook.com/chapter-2#chapter-2-simulation) - [**2\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-2#chapter-summary-1) - [**2\.5** Exercises](https://www.bayesrulesbook.com/chapter-2#exercises-1) - [**2\.5.1** Building up to Bayes’ Rule](https://www.bayesrulesbook.com/chapter-2#building-up-to-bayes-rule) - [**2\.5.2** Practice Bayes’ Rule for events](https://www.bayesrulesbook.com/chapter-2#practice-bayes-rule-for-events) - [**2\.5.3** Practice Bayes’ Rule for random variables](https://www.bayesrulesbook.com/chapter-2#practice-bayes-rule-for-random-variables) - [**2\.5.4** Simulation exercises](https://www.bayesrulesbook.com/chapter-2#simulation-exercises) - [**3** The Beta-Binomial Bayesian Model](https://www.bayesrulesbook.com/chapter-3) - [**3\.1** The Beta prior model](https://www.bayesrulesbook.com/chapter-3#ch3-prior) - [**3\.1.1** Beta foundations](https://www.bayesrulesbook.com/chapter-3#beta-foundations) - [**3\.1.2** Tuning the Beta prior](https://www.bayesrulesbook.com/chapter-3#tuning-the-beta-prior) - [**3\.2** The Binomial data model & likelihood function](https://www.bayesrulesbook.com/chapter-3#the-binomial-data-model-likelihood-function) - [**3\.3** The Beta posterior model](https://www.bayesrulesbook.com/chapter-3#the-beta-posterior-model) - [**3\.4** The Beta-Binomial model](https://www.bayesrulesbook.com/chapter-3#ch3-bbmodel) - [**3\.5** Simulating the Beta-Binomial](https://www.bayesrulesbook.com/chapter-3#chapter-3-simulation) - [**3\.6** Example: Milgram’s behavioral study of obedience](https://www.bayesrulesbook.com/chapter-3#milgram-3) - [**3\.6.1** A Bayesian analysis](https://www.bayesrulesbook.com/chapter-3#a-bayesian-analysis) - [**3\.6.2** The role of ethics in statistics and data science](https://www.bayesrulesbook.com/chapter-3#the-role-of-ethics-in-statistics-and-data-science) - [**3\.7** Chapter summary](https://www.bayesrulesbook.com/chapter-3#chapter-summary-2) - [**3\.8** Exercises](https://www.bayesrulesbook.com/chapter-3#exercises-2) - [**3\.8.1** Practice: Beta prior models](https://www.bayesrulesbook.com/chapter-3#practice-beta-prior-models) - [**3\.8.2** Practice: Beta-Binomial models](https://www.bayesrulesbook.com/chapter-3#practice-beta-binomial-models) - [**4** Balance and Sequentiality in Bayesian Analyses](https://www.bayesrulesbook.com/chapter-4) - [**4\.1** Different priors, different posteriors](https://www.bayesrulesbook.com/chapter-4#ch4-priors) - [**4\.2** Different data, different posteriors](https://www.bayesrulesbook.com/chapter-4#ch4-data) - [**4\.3** Striking a balance between the prior & data](https://www.bayesrulesbook.com/chapter-4#striking-a-balance-between-the-prior-data) - [**4\.3.1** Connecting observations to concepts](https://www.bayesrulesbook.com/chapter-4#connecting-observations-to-concepts) - [**4\.3.2** Connecting concepts to theory](https://www.bayesrulesbook.com/chapter-4#ch4-concepts) - [**4\.4** Sequential analysis: Evolving with data](https://www.bayesrulesbook.com/chapter-4#ch4-sequential) - [**4\.5** Proving data order invariance](https://www.bayesrulesbook.com/chapter-4#proving-data-order-invariance) - [**4\.6** Don’t be stubborn](https://www.bayesrulesbook.com/chapter-4#dont-be-stubborn) - [**4\.7** A note on subjectivity](https://www.bayesrulesbook.com/chapter-4#a-note-on-subjectivity) - [**4\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-4#chapter-summary-3) - [**4\.9** Exercises](https://www.bayesrulesbook.com/chapter-4#exercises-3) - [**4\.9.1** Review exercises](https://www.bayesrulesbook.com/chapter-4#review-exercises) - [**4\.9.2** Practice: Different priors, different posteriors](https://www.bayesrulesbook.com/chapter-4#practice-different-priors-different-posteriors) - [**4\.9.3** Practice: Balancing the data & prior](https://www.bayesrulesbook.com/chapter-4#practice-balancing-the-data-prior) - [**4\.9.4** Practice: Sequentiality](https://www.bayesrulesbook.com/chapter-4#practice-sequentiality) - [**5** Conjugate Families](https://www.bayesrulesbook.com/chapter-5) - [**5\.1** Revisiting choice of prior](https://www.bayesrulesbook.com/chapter-5#revisiting-choice-of-prior) - [**5\.2** Gamma-Poisson conjugate family](https://www.bayesrulesbook.com/chapter-5#gamma-poisson-conjugate-family) - [**5\.2.1** The Poisson data model](https://www.bayesrulesbook.com/chapter-5#the-poisson-data-model) - [**5\.2.2** Potential priors](https://www.bayesrulesbook.com/chapter-5#potential-priors) - [**5\.2.3** Gamma prior](https://www.bayesrulesbook.com/chapter-5#gamma-prior) - [**5\.2.4** Gamma-Poisson conjugacy](https://www.bayesrulesbook.com/chapter-5#gamma-poisson-conjugacy) - [**5\.3** Normal-Normal conjugate family](https://www.bayesrulesbook.com/chapter-5#normal-normal-conjugate-family) - [**5\.3.1** The Normal data model](https://www.bayesrulesbook.com/chapter-5#the-normal-data-model) - [**5\.3.2** Normal prior](https://www.bayesrulesbook.com/chapter-5#normal-prior) - [**5\.3.3** Normal-Normal conjugacy](https://www.bayesrulesbook.com/chapter-5#ch5-n-n-section) - [**5\.3.4** Optional: Proving Normal-Normal conjugacy](https://www.bayesrulesbook.com/chapter-5#ch5-optional) - [**5\.4** Why no simulation in this chapter?](https://www.bayesrulesbook.com/chapter-5#why-no-simulation-in-this-chapter) - [**5\.5** Critiques of conjugate family models](https://www.bayesrulesbook.com/chapter-5#critiques-of-conjugate-family-models) - [**5\.6** Chapter summary](https://www.bayesrulesbook.com/chapter-5#chapter-summary-4) - [**5\.7** Exercises](https://www.bayesrulesbook.com/chapter-5#exercises-4) - [**5\.7.1** Practice: Gamma-Poisson](https://www.bayesrulesbook.com/chapter-5#practice-gamma-poisson) - [**5\.7.2** Practice: Normal-Normal](https://www.bayesrulesbook.com/chapter-5#practice-normal-normal) - [**5\.7.3** General practice exercises](https://www.bayesrulesbook.com/chapter-5#general-practice-exercises) - **II Posterior Simulation & Analysis** - [**6** Approximating the Posterior](https://www.bayesrulesbook.com/chapter-6) - [**6\.1** Grid approximation](https://www.bayesrulesbook.com/chapter-6#grid-approximation) - [**6\.1.1** A Beta-Binomial example](https://www.bayesrulesbook.com/chapter-6#beta-binomial-grid) - [**6\.1.2** A Gamma-Poisson example](https://www.bayesrulesbook.com/chapter-6#Gamma-Poisson-grid) - [**6\.1.3** Limitations](https://www.bayesrulesbook.com/chapter-6#limitations) - [**6\.2** Markov chains via rstan](https://www.bayesrulesbook.com/chapter-6#markov-chains-via-rstan) - [**6\.2.1** A Beta-Binomial example](https://www.bayesrulesbook.com/chapter-6#a-beta-binomial-example) - [**6\.2.2** A Gamma-Poisson example](https://www.bayesrulesbook.com/chapter-6#a-gamma-poisson-example) - [**6\.3** Markov chain diagnostics](https://www.bayesrulesbook.com/chapter-6#diagnostics) - [**6\.3.1** Examining trace plots](https://www.bayesrulesbook.com/chapter-6#chapter-6-trace) - [**6\.3.2** Comparing parallel chains](https://www.bayesrulesbook.com/chapter-6#chapter-6-parallel) - [**6\.3.3** Calculating effective sample size & autocorrelation](https://www.bayesrulesbook.com/chapter-6#calculating-effective-sample-size-autocorrelation) - [**6\.3.4** Calculating R-hat](https://www.bayesrulesbook.com/chapter-6#calculating-r-hat) - [**6\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-6#chapter-summary-5) - [**6\.5** Exercises](https://www.bayesrulesbook.com/chapter-6#exercises-5) - [**6\.5.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-6#conceptual-exercises) - [**6\.5.2** Practice: Grid approximation](https://www.bayesrulesbook.com/chapter-6#practice-grid-approximation) - [**6\.5.3** Practice: MCMC](https://www.bayesrulesbook.com/chapter-6#practice-mcmc) - [**7** MCMC under the Hood](https://www.bayesrulesbook.com/chapter-7) - [**7\.1** The big idea](https://www.bayesrulesbook.com/chapter-7#the-big-idea) - [**7\.2** The Metropolis-Hastings algorithm](https://www.bayesrulesbook.com/chapter-7#the-metropolis-hastings-algorithm) - [**7\.3** Implementing the Metropolis-Hastings](https://www.bayesrulesbook.com/chapter-7#ch7-implementation) - [**7\.4** Tuning the Metropolis-Hastings algorithm](https://www.bayesrulesbook.com/chapter-7#tuning-the-metropolis-hastings-algorithm) - [**7\.5** A Beta-Binomial example](https://www.bayesrulesbook.com/chapter-7#a-beta-binomial-example-1) - [**7\.6** Why the algorithm works](https://www.bayesrulesbook.com/chapter-7#why-the-algorithm-works) - [**7\.7** Variations on the theme](https://www.bayesrulesbook.com/chapter-7#variations-on-the-theme) - [**7\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-7#chapter-summary-6) - [**7\.9** Exercises](https://www.bayesrulesbook.com/chapter-7#exercises-6) - [**7\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-7#conceptual-exercises-1) - [**7\.9.2** Practice: Normal-Normal simulation](https://www.bayesrulesbook.com/chapter-7#practice-normal-normal-simulation) - [**7\.9.3** Practice: Simulating more Bayesian models](https://www.bayesrulesbook.com/chapter-7#practice-simulating-more-bayesian-models) - [**8** Posterior Inference & Prediction](https://www.bayesrulesbook.com/chapter-8) - [**8\.1** Posterior estimation](https://www.bayesrulesbook.com/chapter-8#chapter-8-estimation) - [**8\.2** Posterior hypothesis testing](https://www.bayesrulesbook.com/chapter-8#posterior-hypothesis-testing) - [**8\.2.1** One-sided tests](https://www.bayesrulesbook.com/chapter-8#one-sided-tests) - [**8\.2.2** Two-sided tests](https://www.bayesrulesbook.com/chapter-8#two-sided-tests) - [**8\.3** Posterior prediction](https://www.bayesrulesbook.com/chapter-8#ch8-post-pred) - [**8\.4** Posterior analysis with MCMC](https://www.bayesrulesbook.com/chapter-8#posterior-analysis-with-mcmc) - [**8\.4.1** Posterior simulation](https://www.bayesrulesbook.com/chapter-8#posterior-simulation-1) - [**8\.4.2** Posterior estimation & hypothesis testing](https://www.bayesrulesbook.com/chapter-8#posterior-estimation-hypothesis-testing) - [**8\.4.3** Posterior prediction](https://www.bayesrulesbook.com/chapter-8#ch8-pred) - [**8\.5** Bayesian benefits](https://www.bayesrulesbook.com/chapter-8#benefits-chapter-8) - [**8\.6** Chapter summary](https://www.bayesrulesbook.com/chapter-8#chapter-summary-7) - [**8\.7** Exercises](https://www.bayesrulesbook.com/chapter-8#exercises-7) - [**8\.7.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-8#conceptual-exercises-2) - [**8\.7.2** Practice exercises](https://www.bayesrulesbook.com/chapter-8#practice-exercises) - [**8\.7.3** Applied exercises](https://www.bayesrulesbook.com/chapter-8#applied-exercises) - **III Bayesian Regression & Classification** - [**9** Simple Normal Regression](https://www.bayesrulesbook.com/chapter-9) - [**9\.1** Building the regression model](https://www.bayesrulesbook.com/chapter-9#building-the-regression-model) - [**9\.1.1** Specifying the data model](https://www.bayesrulesbook.com/chapter-9#specifying-the-data-model) - [**9\.1.2** Specifying the priors](https://www.bayesrulesbook.com/chapter-9#specifying-the-priors) - [**9\.1.3** Putting it all together](https://www.bayesrulesbook.com/chapter-9#putting-it-all-together) - [**9\.2** Tuning prior models for regression parameters](https://www.bayesrulesbook.com/chapter-9#tuning-prior-models-for-regression-parameters) - [**9\.3** Posterior simulation](https://www.bayesrulesbook.com/chapter-9#ch9-post-sim) - [**9\.3.1** Simulation via rstanarm](https://www.bayesrulesbook.com/chapter-9#simulation-via-rstanarm) - [**9\.3.2** Optional: Simulation via rstan](https://www.bayesrulesbook.com/chapter-9#optional-simulation-via-rstan) - [**9\.4** Interpreting the posterior](https://www.bayesrulesbook.com/chapter-9#interpreting-the-posterior) - [**9\.5** Posterior prediction](https://www.bayesrulesbook.com/chapter-9#chapter-9-prediction) - [**9\.5.1** Building a posterior predictive model](https://www.bayesrulesbook.com/chapter-9#building-a-posterior-predictive-model) - [**9\.5.2** Posterior prediction with rstanarm](https://www.bayesrulesbook.com/chapter-9#posterior-prediction-with-rstanarm) - [**9\.6** Sequential regression modeling](https://www.bayesrulesbook.com/chapter-9#sequential-regression-modeling) - [**9\.7** Using default rstanarm priors](https://www.bayesrulesbook.com/chapter-9#ch9-default) - [**9\.8** You’re not done yet\!](https://www.bayesrulesbook.com/chapter-9#youre-not-done-yet) - [**9\.9** Chapter summary](https://www.bayesrulesbook.com/chapter-9#chapter-summary-8) - [**9\.10** Exercises](https://www.bayesrulesbook.com/chapter-9#exercises-8) - [**9\.10.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-9#conceptual-exercises-3) - [**9\.10.2** Applied exercises](https://www.bayesrulesbook.com/chapter-9#applied-exercises-1) - [**10** Evaluating Regression Models](https://www.bayesrulesbook.com/chapter-10) - [**10\.1** Is the model fair?](https://www.bayesrulesbook.com/chapter-10#is-the-model-fair) - [**10\.2** How wrong is the model?](https://www.bayesrulesbook.com/chapter-10#chapter-10-wrong-model) - [**10\.2.1** Checking the model assumptions](https://www.bayesrulesbook.com/chapter-10#checking-the-model-assumptions) - [**10\.2.2** Dealing with wrong models](https://www.bayesrulesbook.com/chapter-10#dealing-with-wrong-models) - [**10\.3** How accurate are the posterior predictive models?](https://www.bayesrulesbook.com/chapter-10#chapter-10-train-test) - [**10\.3.1** Posterior predictive summaries](https://www.bayesrulesbook.com/chapter-10#simple-summary-10) - [**10\.3.2** Cross-validation](https://www.bayesrulesbook.com/chapter-10#cross-validation) - [**10\.3.3** Expected log-predictive density](https://www.bayesrulesbook.com/chapter-10#chapter-10-elpd) - [**10\.3.4** Improving posterior predictive accuracy](https://www.bayesrulesbook.com/chapter-10#improving-posterior-predictive-accuracy) - [**10\.4** How good is the MCMC simulation vs how good is the model?](https://www.bayesrulesbook.com/chapter-10#how-good-is-the-mcmc-simulation-vs-how-good-is-the-model) - [**10\.5** Chapter summary](https://www.bayesrulesbook.com/chapter-10#chapter-summary-9) - [**10\.6** Exercises](https://www.bayesrulesbook.com/chapter-10#exercises-9) - [**10\.6.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-10#conceptual-exercises-4) - [**10\.6.2** Applied exercises](https://www.bayesrulesbook.com/chapter-10#applied-exercises-2) - [**10\.6.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-10#open-ended-exercises) - [**11** Extending the Normal Regression Model](https://www.bayesrulesbook.com/chapter-11) - [**11\.1** Utilizing a categorical predictor](https://www.bayesrulesbook.com/chapter-11#utilizing-a-categorical-predictor) - [**11\.1.1** Building the model](https://www.bayesrulesbook.com/chapter-11#building-the-model) - [**11\.1.2** Simulating the posterior](https://www.bayesrulesbook.com/chapter-11#simulating-the-posterior) - [**11\.2** Utilizing two predictors](https://www.bayesrulesbook.com/chapter-11#ch-11-2-predictors) - [**11\.2.1** Building the model](https://www.bayesrulesbook.com/chapter-11#building-the-model-1) - [**11\.2.2** Understanding the priors](https://www.bayesrulesbook.com/chapter-11#understanding-the-priors) - [**11\.2.3** Simulating the posterior](https://www.bayesrulesbook.com/chapter-11#simulating-the-posterior-1) - [**11\.2.4** Posterior prediction](https://www.bayesrulesbook.com/chapter-11#posterior-prediction) - [**11\.3** Optional: Utilizing interaction terms](https://www.bayesrulesbook.com/chapter-11#optional-utilizing-interaction-terms) - [**11\.3.1** Building the model](https://www.bayesrulesbook.com/chapter-11#building-the-model-2) - [**11\.3.2** Simulating the posterior](https://www.bayesrulesbook.com/chapter-11#simulating-the-posterior-2) - [**11\.3.3** Do you need an interaction term?](https://www.bayesrulesbook.com/chapter-11#do-you-need-an-interaction-term) - [**11\.4** Dreaming bigger: Utilizing more than 2 predictors\!](https://www.bayesrulesbook.com/chapter-11#ch11-more) - [**11\.5** Model evaluation & comparison](https://www.bayesrulesbook.com/chapter-11#ch11-model-comparison) - [**11\.5.1** Evaluating predictive accuracy using visualizations](https://www.bayesrulesbook.com/chapter-11#evaluating-predictive-accuracy-using-visualizations) - [**11\.5.2** Evaluating predictive accuracy using cross-validation](https://www.bayesrulesbook.com/chapter-11#evaluating-predictive-accuracy-using-cross-validation) - [**11\.5.3** Evaluating predictive accuracy using ELPD](https://www.bayesrulesbook.com/chapter-11#evaluating-predictive-accuracy-using-elpd) - [**11\.5.4** The bias-variance trade-off](https://www.bayesrulesbook.com/chapter-11#the-bias-variance-trade-off) - [**11\.6** Chapter summary](https://www.bayesrulesbook.com/chapter-11#chapter-summary-10) - [**11\.7** Exercises](https://www.bayesrulesbook.com/chapter-11#exercises-10) - [**11\.7.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-11#conceptual-exercises-5) - [**11\.7.2** Applied exercises](https://www.bayesrulesbook.com/chapter-11#applied-exercises-3) - [**11\.7.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-11#open-ended-exercises-1) - [**12** Poisson & Negative Binomial Regression](https://www.bayesrulesbook.com/chapter-12) - [**12\.1** Building the Poisson regression model](https://www.bayesrulesbook.com/chapter-12#building-the-poisson-regression-model) - [**12\.1.1** Specifying the data model](https://www.bayesrulesbook.com/chapter-12#specifying-the-data-model-1) - [**12\.1.2** Specifying the priors](https://www.bayesrulesbook.com/chapter-12#ch12-prior-spec) - [**12\.2** Simulating the posterior](https://www.bayesrulesbook.com/chapter-12#ch12-simulation) - [**12\.3** Interpreting the posterior](https://www.bayesrulesbook.com/chapter-12#ch12-interp-pois) - [**12\.4** Posterior prediction](https://www.bayesrulesbook.com/chapter-12#posterior-prediction-1) - [**12\.5** Model evaluation](https://www.bayesrulesbook.com/chapter-12#model-evaluation) - [**12\.6** Negative Binomial regression for overdispersed counts](https://www.bayesrulesbook.com/chapter-12#chapter-12-overdispersion) - [**12\.7** Generalized linear models: Building on the theme](https://www.bayesrulesbook.com/chapter-12#ch12-glm) - [**12\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-12#chapter-summary-11) - [**12\.9** Exercises](https://www.bayesrulesbook.com/chapter-12#exercises-11) - [**12\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-12#conceptual-exercises-6) - [**12\.9.2** Applied exercises](https://www.bayesrulesbook.com/chapter-12#applied-exercises-4) - [**13** Logistic Regression](https://www.bayesrulesbook.com/chapter-13) - [**13\.1** Pause: Odds & probability](https://www.bayesrulesbook.com/chapter-13#pause-odds-probability) - [**13\.2** Building the logistic regression model](https://www.bayesrulesbook.com/chapter-13#building-the-logistic-regression-model) - [**13\.2.1** Specifying the data model](https://www.bayesrulesbook.com/chapter-13#specifying-the-data-model-2) - [**13\.2.2** Specifying the priors](https://www.bayesrulesbook.com/chapter-13#specifying-the-priors-1) - [**13\.3** Simulating the posterior](https://www.bayesrulesbook.com/chapter-13#ch13-post-sim-sec) - [**13\.4** Prediction & classification](https://www.bayesrulesbook.com/chapter-13#chapter-13-prediction) - [**13\.5** Model evaluation](https://www.bayesrulesbook.com/chapter-13#model-evaluation-1) - [**13\.6** Extending the model](https://www.bayesrulesbook.com/chapter-13#extending-the-model) - [**13\.7** Chapter summary](https://www.bayesrulesbook.com/chapter-13#chapter-summary-12) - [**13\.8** Exercises](https://www.bayesrulesbook.com/chapter-13#exercises-12) - [**13\.8.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-13#conceptual-exercises-7) - [**13\.8.2** Applied exercises](https://www.bayesrulesbook.com/chapter-13#applied-exercises-5) - [**13\.8.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-13#open-ended-exercises-2) - [**14** Naive Bayes Classification](https://www.bayesrulesbook.com/chapter-14) - [**14\.1** Classifying one penguin](https://www.bayesrulesbook.com/chapter-14#naive-one-case) - [**14\.1.1** One categorical predictor](https://www.bayesrulesbook.com/chapter-14#one-categorical-predictor) - [**14\.1.2** One quantitative predictor](https://www.bayesrulesbook.com/chapter-14#naive-one-quant) - [**14\.1.3** Two predictors](https://www.bayesrulesbook.com/chapter-14#naive-two-quant) - [**14\.2** Implementing & evaluating naive Bayes classification](https://www.bayesrulesbook.com/chapter-14#implementing-evaluating-naive-bayes-classification) - [**14\.3** Naive Bayes vs logistic regression](https://www.bayesrulesbook.com/chapter-14#naive-bayes-vs-logistic-regression) - [**14\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-14#chapter-summary-13) - [**14\.5** Exercises](https://www.bayesrulesbook.com/chapter-14#exercises-13) - [**14\.5.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-14#conceptual-exercises-8) - [**14\.5.2** Applied exercises](https://www.bayesrulesbook.com/chapter-14#applied-exercises-6) - [**14\.5.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-14#open-ended-exercises-3) - **IV Hierarchical Bayesian models** - [**15** Hierarchical Models are Exciting](https://www.bayesrulesbook.com/chapter-15) - [**15\.1** Complete pooling](https://www.bayesrulesbook.com/chapter-15#ch15-complete) - [**15\.2** No pooling](https://www.bayesrulesbook.com/chapter-15#no-pooling) - [**15\.3** Hierarchical data](https://www.bayesrulesbook.com/chapter-15#hierarchical-data) - [**15\.4** Partial pooling with hierarchical models](https://www.bayesrulesbook.com/chapter-15#partial-pooling-with-hierarchical-models) - [**15\.5** Chapter summary](https://www.bayesrulesbook.com/chapter-15#chapter-summary-14) - [**15\.6** Exercises](https://www.bayesrulesbook.com/chapter-15#exercises-14) - [**15\.6.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-15#conceptual-exercises-9) - [**15\.6.2** Applied exercises](https://www.bayesrulesbook.com/chapter-15#applied-exercises-7) - [**16** (Normal) Hierarchical Models without Predictors](https://www.bayesrulesbook.com/chapter-16) - [**16\.1** Complete pooled model](https://www.bayesrulesbook.com/chapter-16#chapter-16-complete-pooling) - [**16\.2** No pooled model](https://www.bayesrulesbook.com/chapter-16#chapter-16-no-pooling) - [**16\.3** Building the hierarchical model](https://www.bayesrulesbook.com/chapter-16#hierarchical-building-16) - [**16\.3.1** The hierarchy](https://www.bayesrulesbook.com/chapter-16#the-hierarchy) - [**16\.3.2** Another way to think about it](https://www.bayesrulesbook.com/chapter-16#another-way-to-think-about-it) - [**16\.3.3** Within- vs between-group variability](https://www.bayesrulesbook.com/chapter-16#ch16-within-btwn) - [**16\.4** Posterior analysis](https://www.bayesrulesbook.com/chapter-16#ch-16-analyze) - [**16\.4.1** Posterior simulation](https://www.bayesrulesbook.com/chapter-16#posterior-simulation-2) - [**16\.4.2** Posterior analysis of global parameters](https://www.bayesrulesbook.com/chapter-16#posterior-analysis-of-global-parameters) - [**16\.4.3** Posterior analysis of group-specific parameters](https://www.bayesrulesbook.com/chapter-16#posterior-analysis-of-group-specific-parameters) - [**16\.5** Posterior prediction](https://www.bayesrulesbook.com/chapter-16#ch16-prediction) - [**16\.6** Shrinkage & the bias-variance trade-off](https://www.bayesrulesbook.com/chapter-16#shrinkage-the-bias-variance-trade-off) - [**16\.7** Not everything is hierarchical](https://www.bayesrulesbook.com/chapter-16#ch-16-nonhierarchical) - [**16\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-16#chapter-summary-15) - [**16\.9** Exercises](https://www.bayesrulesbook.com/chapter-16#exercises-15) - [**16\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-16#conceptual-exercises-10) - [**16\.9.2** Applied exercises](https://www.bayesrulesbook.com/chapter-16#applied-exercises-8) - [**17** (Normal) Hierarchical Models with Predictors](https://www.bayesrulesbook.com/chapter-17) - [**17\.1** First steps: Complete pooling](https://www.bayesrulesbook.com/chapter-17#first-steps-complete-pooling) - [**17\.2** Hierarchical model with varying intercepts](https://www.bayesrulesbook.com/chapter-17#hierarchical-model-with-varying-intercepts) - [**17\.2.1** Model building](https://www.bayesrulesbook.com/chapter-17#model-building) - [**17\.2.2** Another way to think about it](https://www.bayesrulesbook.com/chapter-17#another-way-to-think-about-it-1) - [**17\.2.3** Tuning the prior](https://www.bayesrulesbook.com/chapter-17#tuning-the-prior) - [**17\.2.4** Posterior simulation & analysis](https://www.bayesrulesbook.com/chapter-17#chapter-17-random-intercepts) - [**17\.3** Hierarchical model with varying intercepts & slopes](https://www.bayesrulesbook.com/chapter-17#hierarchical-model-with-varying-intercepts-slopes) - [**17\.3.1** Model building](https://www.bayesrulesbook.com/chapter-17#model-building-1) - [**17\.3.2** Optional: The decomposition of covariance model](https://www.bayesrulesbook.com/chapter-17#optional-the-decomposition-of-covariance-model) - [**17\.3.3** Posterior simulation & analysis](https://www.bayesrulesbook.com/chapter-17#ch-17-rand-int-slope-sim) - [**17\.4** Model evaluation & selection](https://www.bayesrulesbook.com/chapter-17#model-evaluation-selection) - [**17\.5** Posterior prediction](https://www.bayesrulesbook.com/chapter-17#posterior-prediction-2) - [**17\.6** Details: Longitudinal data](https://www.bayesrulesbook.com/chapter-17#details-longitudinal-data) - [**17\.7** Example: Danceability](https://www.bayesrulesbook.com/chapter-17#example-danceability) - [**17\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-17#chapter-summary-16) - [**17\.9** Exercises](https://www.bayesrulesbook.com/chapter-17#exercises-16) - [**17\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-17#conceptual-exercises-11) - [**17\.9.2** Applied exercises](https://www.bayesrulesbook.com/chapter-17#applied-exercises-9) - [**17\.9.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-17#open-ended-exercises-4) - [**18** Non-Normal Hierarchical Regression & Classification](https://www.bayesrulesbook.com/chapter-18) - [**18\.1** Hierarchical logistic regression](https://www.bayesrulesbook.com/chapter-18#hierarchical-logistic-regression) - [**18\.1.1** Model building & simulation](https://www.bayesrulesbook.com/chapter-18#model-building-simulation) - [**18\.1.2** Posterior analysis](https://www.bayesrulesbook.com/chapter-18#posterior-analysis) - [**18\.1.3** Posterior classification](https://www.bayesrulesbook.com/chapter-18#posterior-classification) - [**18\.1.4** Model evaluation](https://www.bayesrulesbook.com/chapter-18#model-evaluation-2) - [**18\.2** Hierarchical Poisson & Negative Binomial regression](https://www.bayesrulesbook.com/chapter-18#hierarchical-poisson-negative-binomial-regression) - [**18\.2.1** Model building & simulation](https://www.bayesrulesbook.com/chapter-18#ch-18-rat-sim) - [**18\.2.2** Posterior analysis](https://www.bayesrulesbook.com/chapter-18#posterior-analysis-1) - [**18\.2.3** Model evaluation](https://www.bayesrulesbook.com/chapter-18#model-evaluation-3) - [**18\.3** Chapter summary](https://www.bayesrulesbook.com/chapter-18#chapter-summary-17) - [**18\.4** Exercises](https://www.bayesrulesbook.com/chapter-18#exercises-17) - [**18\.4.1** Applied & conceptual exercises](https://www.bayesrulesbook.com/chapter-18#applied-conceptual-exercises) - [**18\.4.2** Open-ended exercises](https://www.bayesrulesbook.com/chapter-18#open-ended-exercises-5) - [**19** Adding More Layers](https://www.bayesrulesbook.com/chapter-19) - [**19\.1** Group-level predictors](https://www.bayesrulesbook.com/chapter-19#group-level-predictors) - [**19\.1.1** A model using only individual-level predictors](https://www.bayesrulesbook.com/chapter-19#a-model-using-only-individual-level-predictors) - [**19\.1.2** Incorporating group-level predictors](https://www.bayesrulesbook.com/chapter-19#incorporating-group-level-predictors) - [**19\.1.3** Posterior simulation & global analysis](https://www.bayesrulesbook.com/chapter-19#posterior-simulation-global-analysis) - [**19\.1.4** Posterior group-level analysis](https://www.bayesrulesbook.com/chapter-19#posterior-group-level-analysis) - [**19\.1.5** We’re just scratching the surface\!](https://www.bayesrulesbook.com/chapter-19#were-just-scratching-the-surface) - [**19\.2** Incorporating two (or more!) grouping variables](https://www.bayesrulesbook.com/chapter-19#incorporating-two-or-more-grouping-variables) - [**19\.2.1** Data with two grouping variables](https://www.bayesrulesbook.com/chapter-19#data-with-two-grouping-variables) - [**19\.2.2** Building a model with two grouping variables](https://www.bayesrulesbook.com/chapter-19#building-a-model-with-two-grouping-variables) - [**19\.2.3** Simulating models with two grouping variables](https://www.bayesrulesbook.com/chapter-19#simulating-models-with-two-grouping-variables) - [**19\.2.4** Examining the group-specific parameters](https://www.bayesrulesbook.com/chapter-19#examining-the-group-specific-parameters) - [**19\.2.5** We’re just scratching the surface\!](https://www.bayesrulesbook.com/chapter-19#were-just-scratching-the-surface-1) - [**19\.3** Exercises](https://www.bayesrulesbook.com/chapter-19#exercises-18) - [**19\.3.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-19#conceptual-exercises-12) - [**19\.3.2** Applied exercises](https://www.bayesrulesbook.com/chapter-19#applied-exercises-10) - [**19\.4** Goodbye\!](https://www.bayesrulesbook.com/chapter-19#goodbye) - [References](https://www.bayesrulesbook.com/references) - [Published with bookdown](https://bookdown.org/) # [Bayes Rules! An Introduction to Applied Bayesian Modeling](https://www.bayesrulesbook.com/) # Bayes Rules! An Introduction to Applied Bayesian Modeling *Alicia A. Johnson, Miles Q. Ott, Mine Dogucu* *2021-12-01* # News **In addition to this online version**, *Bayes Rules\!* is now [available in print by CRC Press](https://www.routledge.com/Bayes-Rules-An-Introduction-to-Applied-Bayesian-Modeling/Johnson-Ott-Dogucu/p/book/9780367255398?utm_source=website&utm_medium=shared_link&utm_campaign=B023819_jm1_5ll_7pp_d676_bayesrulesauthorshare%0A%0A). The book is 20% off with the discount code BRD20. ![](https://www.bayesrulesbook.com/chapters/figs/index/book_cover.jpeg) For other information and resources related to the book, check out <https://bayes-rules.github.io/>.
Readable Markdown
- [![](https://www.bayesrulesbook.com/chapters/figs/index/bayes-rules-hex.png)](https://www.bayesrulesbook.com/) - [News](https://www.bayesrulesbook.com/) - [Foreword](https://www.bayesrulesbook.com/foreword) - [Preface](https://www.bayesrulesbook.com/preface) - [Audience](https://www.bayesrulesbook.com/preface#audience) - [Navigating this book](https://www.bayesrulesbook.com/preface#navigating-this-book) - [Getting set up](https://www.bayesrulesbook.com/preface#setup) - [Accessibility and inclusion](https://www.bayesrulesbook.com/preface#accessibility-and-inclusion) - [Contact us](https://www.bayesrulesbook.com/preface#contact-us) - [Acknowledgments](https://www.bayesrulesbook.com/preface#acknowledgments) - [License](https://www.bayesrulesbook.com/preface#license) - [About the Authors](https://www.bayesrulesbook.com/about-the-authors) - **I Bayesian Foundations** - [**1** The Big (Bayesian) Picture](https://www.bayesrulesbook.com/chapter-1) - [**1\.1** Thinking like a Bayesian](https://www.bayesrulesbook.com/chapter-1#thinking-like-a-bayesian) - [**1\.1.1** Quiz yourself](https://www.bayesrulesbook.com/chapter-1#quiz-yourself-1) - [**1\.1.2** The meaning of probability](https://www.bayesrulesbook.com/chapter-1#bayes-v-freq-probability) - [**1\.1.3** The Bayesian balancing act](https://www.bayesrulesbook.com/chapter-1#the-bayesian-balancing-act) - [**1\.1.4** Asking questions](https://www.bayesrulesbook.com/chapter-1#asking-questions) - [**1\.2** A quick history lesson](https://www.bayesrulesbook.com/chapter-1#a-quick-history-lesson) - [**1\.3** A look ahead](https://www.bayesrulesbook.com/chapter-1#a-look-ahead) - [**1\.3.1** Unit 1: Bayesian foundations](https://www.bayesrulesbook.com/chapter-1#ch1-unit-1) - [**1\.3.2** Unit 2: Posterior simulation & analysis](https://www.bayesrulesbook.com/chapter-1#unit-2-posterior-simulation-analysis) - [**1\.3.3** Unit 3: Bayesian regression & classification](https://www.bayesrulesbook.com/chapter-1#unit-3-bayesian-regression-classification) - [**1\.3.4** Unit 4: Hierarchical Bayesian models](https://www.bayesrulesbook.com/chapter-1#unit-4-hierarchical-bayesian-models) - [**1\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-1#chapter-summary) - [**1\.5** Exercises](https://www.bayesrulesbook.com/chapter-1#exercises) - [**2** Bayes’ Rule](https://www.bayesrulesbook.com/chapter-2) - [**2\.1** Building a Bayesian model for events](https://www.bayesrulesbook.com/chapter-2#building-a-bayesian-model-for-events) - [**2\.1.1** Prior probability model](https://www.bayesrulesbook.com/chapter-2#prior-probability-model) - [**2\.1.2** Conditional probability & likelihood](https://www.bayesrulesbook.com/chapter-2#conditional-probability-likelihood) - [**2\.1.3** Normalizing constants](https://www.bayesrulesbook.com/chapter-2#normalizing-constants) - [**2\.1.4** Posterior probability model via Bayes’ Rule\!](https://www.bayesrulesbook.com/chapter-2#posterior-probability-model-via-bayes-rule) - [**2\.1.5** Posterior simulation](https://www.bayesrulesbook.com/chapter-2#posterior-simulation) - [**2\.2** Example: Pop vs soda vs coke](https://www.bayesrulesbook.com/chapter-2#michelle-simple) - [**2\.3** Building a Bayesian model for random variables](https://www.bayesrulesbook.com/chapter-2#cousin-cole) - [**2\.3.1** Prior probability model](https://www.bayesrulesbook.com/chapter-2#prior-probability-model-1) - [**2\.3.2** The Binomial data model](https://www.bayesrulesbook.com/chapter-2#chapter-2-binomial-likelihood) - [**2\.3.3** The Binomial likelihood function](https://www.bayesrulesbook.com/chapter-2#the-binomial-likelihood-function) - [**2\.3.4** Normalizing constant](https://www.bayesrulesbook.com/chapter-2#normalizing-constant) - [**2\.3.5** Posterior probability model](https://www.bayesrulesbook.com/chapter-2#posterior-probability-model) - [**2\.3.6** Posterior shortcut](https://www.bayesrulesbook.com/chapter-2#shortcut-2) - [**2\.3.7** Posterior simulation](https://www.bayesrulesbook.com/chapter-2#chapter-2-simulation) - [**2\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-2#chapter-summary-1) - [**2\.5** Exercises](https://www.bayesrulesbook.com/chapter-2#exercises-1) - [**2\.5.1** Building up to Bayes’ Rule](https://www.bayesrulesbook.com/chapter-2#building-up-to-bayes-rule) - [**2\.5.2** Practice Bayes’ Rule for events](https://www.bayesrulesbook.com/chapter-2#practice-bayes-rule-for-events) - [**2\.5.3** Practice Bayes’ Rule for random variables](https://www.bayesrulesbook.com/chapter-2#practice-bayes-rule-for-random-variables) - [**2\.5.4** Simulation exercises](https://www.bayesrulesbook.com/chapter-2#simulation-exercises) - [**3** The Beta-Binomial Bayesian Model](https://www.bayesrulesbook.com/chapter-3) - [**3\.1** The Beta prior model](https://www.bayesrulesbook.com/chapter-3#ch3-prior) - [**3\.1.1** Beta foundations](https://www.bayesrulesbook.com/chapter-3#beta-foundations) - [**3\.1.2** Tuning the Beta prior](https://www.bayesrulesbook.com/chapter-3#tuning-the-beta-prior) - [**3\.2** The Binomial data model & likelihood function](https://www.bayesrulesbook.com/chapter-3#the-binomial-data-model-likelihood-function) - [**3\.3** The Beta posterior model](https://www.bayesrulesbook.com/chapter-3#the-beta-posterior-model) - [**3\.4** The Beta-Binomial model](https://www.bayesrulesbook.com/chapter-3#ch3-bbmodel) - [**3\.5** Simulating the Beta-Binomial](https://www.bayesrulesbook.com/chapter-3#chapter-3-simulation) - [**3\.6** Example: Milgram’s behavioral study of obedience](https://www.bayesrulesbook.com/chapter-3#milgram-3) - [**3\.6.1** A Bayesian analysis](https://www.bayesrulesbook.com/chapter-3#a-bayesian-analysis) - [**3\.6.2** The role of ethics in statistics and data science](https://www.bayesrulesbook.com/chapter-3#the-role-of-ethics-in-statistics-and-data-science) - [**3\.7** Chapter summary](https://www.bayesrulesbook.com/chapter-3#chapter-summary-2) - [**3\.8** Exercises](https://www.bayesrulesbook.com/chapter-3#exercises-2) - [**3\.8.1** Practice: Beta prior models](https://www.bayesrulesbook.com/chapter-3#practice-beta-prior-models) - [**3\.8.2** Practice: Beta-Binomial models](https://www.bayesrulesbook.com/chapter-3#practice-beta-binomial-models) - [**4** Balance and Sequentiality in Bayesian Analyses](https://www.bayesrulesbook.com/chapter-4) - [**4\.1** Different priors, different posteriors](https://www.bayesrulesbook.com/chapter-4#ch4-priors) - [**4\.2** Different data, different posteriors](https://www.bayesrulesbook.com/chapter-4#ch4-data) - [**4\.3** Striking a balance between the prior & data](https://www.bayesrulesbook.com/chapter-4#striking-a-balance-between-the-prior-data) - [**4\.3.1** Connecting observations to concepts](https://www.bayesrulesbook.com/chapter-4#connecting-observations-to-concepts) - [**4\.3.2** Connecting concepts to theory](https://www.bayesrulesbook.com/chapter-4#ch4-concepts) - [**4\.4** Sequential analysis: Evolving with data](https://www.bayesrulesbook.com/chapter-4#ch4-sequential) - [**4\.5** Proving data order invariance](https://www.bayesrulesbook.com/chapter-4#proving-data-order-invariance) - [**4\.6** Don’t be stubborn](https://www.bayesrulesbook.com/chapter-4#dont-be-stubborn) - [**4\.7** A note on subjectivity](https://www.bayesrulesbook.com/chapter-4#a-note-on-subjectivity) - [**4\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-4#chapter-summary-3) - [**4\.9** Exercises](https://www.bayesrulesbook.com/chapter-4#exercises-3) - [**4\.9.1** Review exercises](https://www.bayesrulesbook.com/chapter-4#review-exercises) - [**4\.9.2** Practice: Different priors, different posteriors](https://www.bayesrulesbook.com/chapter-4#practice-different-priors-different-posteriors) - [**4\.9.3** Practice: Balancing the data & prior](https://www.bayesrulesbook.com/chapter-4#practice-balancing-the-data-prior) - [**4\.9.4** Practice: Sequentiality](https://www.bayesrulesbook.com/chapter-4#practice-sequentiality) - [**5** Conjugate Families](https://www.bayesrulesbook.com/chapter-5) - [**5\.1** Revisiting choice of prior](https://www.bayesrulesbook.com/chapter-5#revisiting-choice-of-prior) - [**5\.2** Gamma-Poisson conjugate family](https://www.bayesrulesbook.com/chapter-5#gamma-poisson-conjugate-family) - [**5\.2.1** The Poisson data model](https://www.bayesrulesbook.com/chapter-5#the-poisson-data-model) - [**5\.2.2** Potential priors](https://www.bayesrulesbook.com/chapter-5#potential-priors) - [**5\.2.3** Gamma prior](https://www.bayesrulesbook.com/chapter-5#gamma-prior) - [**5\.2.4** Gamma-Poisson conjugacy](https://www.bayesrulesbook.com/chapter-5#gamma-poisson-conjugacy) - [**5\.3** Normal-Normal conjugate family](https://www.bayesrulesbook.com/chapter-5#normal-normal-conjugate-family) - [**5\.3.1** The Normal data model](https://www.bayesrulesbook.com/chapter-5#the-normal-data-model) - [**5\.3.2** Normal prior](https://www.bayesrulesbook.com/chapter-5#normal-prior) - [**5\.3.3** Normal-Normal conjugacy](https://www.bayesrulesbook.com/chapter-5#ch5-n-n-section) - [**5\.3.4** Optional: Proving Normal-Normal conjugacy](https://www.bayesrulesbook.com/chapter-5#ch5-optional) - [**5\.4** Why no simulation in this chapter?](https://www.bayesrulesbook.com/chapter-5#why-no-simulation-in-this-chapter) - [**5\.5** Critiques of conjugate family models](https://www.bayesrulesbook.com/chapter-5#critiques-of-conjugate-family-models) - [**5\.6** Chapter summary](https://www.bayesrulesbook.com/chapter-5#chapter-summary-4) - [**5\.7** Exercises](https://www.bayesrulesbook.com/chapter-5#exercises-4) - [**5\.7.1** Practice: Gamma-Poisson](https://www.bayesrulesbook.com/chapter-5#practice-gamma-poisson) - [**5\.7.2** Practice: Normal-Normal](https://www.bayesrulesbook.com/chapter-5#practice-normal-normal) - [**5\.7.3** General practice exercises](https://www.bayesrulesbook.com/chapter-5#general-practice-exercises) - **II Posterior Simulation & Analysis** - [**6** Approximating the Posterior](https://www.bayesrulesbook.com/chapter-6) - [**6\.1** Grid approximation](https://www.bayesrulesbook.com/chapter-6#grid-approximation) - [**6\.1.1** A Beta-Binomial example](https://www.bayesrulesbook.com/chapter-6#beta-binomial-grid) - [**6\.1.2** A Gamma-Poisson example](https://www.bayesrulesbook.com/chapter-6#Gamma-Poisson-grid) - [**6\.1.3** Limitations](https://www.bayesrulesbook.com/chapter-6#limitations) - [**6\.2** Markov chains via rstan](https://www.bayesrulesbook.com/chapter-6#markov-chains-via-rstan) - [**6\.2.1** A Beta-Binomial example](https://www.bayesrulesbook.com/chapter-6#a-beta-binomial-example) - [**6\.2.2** A Gamma-Poisson example](https://www.bayesrulesbook.com/chapter-6#a-gamma-poisson-example) - [**6\.3** Markov chain diagnostics](https://www.bayesrulesbook.com/chapter-6#diagnostics) - [**6\.3.1** Examining trace plots](https://www.bayesrulesbook.com/chapter-6#chapter-6-trace) - [**6\.3.2** Comparing parallel chains](https://www.bayesrulesbook.com/chapter-6#chapter-6-parallel) - [**6\.3.3** Calculating effective sample size & autocorrelation](https://www.bayesrulesbook.com/chapter-6#calculating-effective-sample-size-autocorrelation) - [**6\.3.4** Calculating R-hat](https://www.bayesrulesbook.com/chapter-6#calculating-r-hat) - [**6\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-6#chapter-summary-5) - [**6\.5** Exercises](https://www.bayesrulesbook.com/chapter-6#exercises-5) - [**6\.5.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-6#conceptual-exercises) - [**6\.5.2** Practice: Grid approximation](https://www.bayesrulesbook.com/chapter-6#practice-grid-approximation) - [**6\.5.3** Practice: MCMC](https://www.bayesrulesbook.com/chapter-6#practice-mcmc) - [**7** MCMC under the Hood](https://www.bayesrulesbook.com/chapter-7) - [**7\.1** The big idea](https://www.bayesrulesbook.com/chapter-7#the-big-idea) - [**7\.2** The Metropolis-Hastings algorithm](https://www.bayesrulesbook.com/chapter-7#the-metropolis-hastings-algorithm) - [**7\.3** Implementing the Metropolis-Hastings](https://www.bayesrulesbook.com/chapter-7#ch7-implementation) - [**7\.4** Tuning the Metropolis-Hastings algorithm](https://www.bayesrulesbook.com/chapter-7#tuning-the-metropolis-hastings-algorithm) - [**7\.5** A Beta-Binomial example](https://www.bayesrulesbook.com/chapter-7#a-beta-binomial-example-1) - [**7\.6** Why the algorithm works](https://www.bayesrulesbook.com/chapter-7#why-the-algorithm-works) - [**7\.7** Variations on the theme](https://www.bayesrulesbook.com/chapter-7#variations-on-the-theme) - [**7\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-7#chapter-summary-6) - [**7\.9** Exercises](https://www.bayesrulesbook.com/chapter-7#exercises-6) - [**7\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-7#conceptual-exercises-1) - [**7\.9.2** Practice: Normal-Normal simulation](https://www.bayesrulesbook.com/chapter-7#practice-normal-normal-simulation) - [**7\.9.3** Practice: Simulating more Bayesian models](https://www.bayesrulesbook.com/chapter-7#practice-simulating-more-bayesian-models) - [**8** Posterior Inference & Prediction](https://www.bayesrulesbook.com/chapter-8) - [**8\.1** Posterior estimation](https://www.bayesrulesbook.com/chapter-8#chapter-8-estimation) - [**8\.2** Posterior hypothesis testing](https://www.bayesrulesbook.com/chapter-8#posterior-hypothesis-testing) - [**8\.2.1** One-sided tests](https://www.bayesrulesbook.com/chapter-8#one-sided-tests) - [**8\.2.2** Two-sided tests](https://www.bayesrulesbook.com/chapter-8#two-sided-tests) - [**8\.3** Posterior prediction](https://www.bayesrulesbook.com/chapter-8#ch8-post-pred) - [**8\.4** Posterior analysis with MCMC](https://www.bayesrulesbook.com/chapter-8#posterior-analysis-with-mcmc) - [**8\.4.1** Posterior simulation](https://www.bayesrulesbook.com/chapter-8#posterior-simulation-1) - [**8\.4.2** Posterior estimation & hypothesis testing](https://www.bayesrulesbook.com/chapter-8#posterior-estimation-hypothesis-testing) - [**8\.4.3** Posterior prediction](https://www.bayesrulesbook.com/chapter-8#ch8-pred) - [**8\.5** Bayesian benefits](https://www.bayesrulesbook.com/chapter-8#benefits-chapter-8) - [**8\.6** Chapter summary](https://www.bayesrulesbook.com/chapter-8#chapter-summary-7) - [**8\.7** Exercises](https://www.bayesrulesbook.com/chapter-8#exercises-7) - [**8\.7.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-8#conceptual-exercises-2) - [**8\.7.2** Practice exercises](https://www.bayesrulesbook.com/chapter-8#practice-exercises) - [**8\.7.3** Applied exercises](https://www.bayesrulesbook.com/chapter-8#applied-exercises) - **III Bayesian Regression & Classification** - [**9** Simple Normal Regression](https://www.bayesrulesbook.com/chapter-9) - [**9\.1** Building the regression model](https://www.bayesrulesbook.com/chapter-9#building-the-regression-model) - [**9\.1.1** Specifying the data model](https://www.bayesrulesbook.com/chapter-9#specifying-the-data-model) - [**9\.1.2** Specifying the priors](https://www.bayesrulesbook.com/chapter-9#specifying-the-priors) - [**9\.1.3** Putting it all together](https://www.bayesrulesbook.com/chapter-9#putting-it-all-together) - [**9\.2** Tuning prior models for regression parameters](https://www.bayesrulesbook.com/chapter-9#tuning-prior-models-for-regression-parameters) - [**9\.3** Posterior simulation](https://www.bayesrulesbook.com/chapter-9#ch9-post-sim) - [**9\.3.1** Simulation via rstanarm](https://www.bayesrulesbook.com/chapter-9#simulation-via-rstanarm) - [**9\.3.2** Optional: Simulation via rstan](https://www.bayesrulesbook.com/chapter-9#optional-simulation-via-rstan) - [**9\.4** Interpreting the posterior](https://www.bayesrulesbook.com/chapter-9#interpreting-the-posterior) - [**9\.5** Posterior prediction](https://www.bayesrulesbook.com/chapter-9#chapter-9-prediction) - [**9\.5.1** Building a posterior predictive model](https://www.bayesrulesbook.com/chapter-9#building-a-posterior-predictive-model) - [**9\.5.2** Posterior prediction with rstanarm](https://www.bayesrulesbook.com/chapter-9#posterior-prediction-with-rstanarm) - [**9\.6** Sequential regression modeling](https://www.bayesrulesbook.com/chapter-9#sequential-regression-modeling) - [**9\.7** Using default rstanarm priors](https://www.bayesrulesbook.com/chapter-9#ch9-default) - [**9\.8** You’re not done yet\!](https://www.bayesrulesbook.com/chapter-9#youre-not-done-yet) - [**9\.9** Chapter summary](https://www.bayesrulesbook.com/chapter-9#chapter-summary-8) - [**9\.10** Exercises](https://www.bayesrulesbook.com/chapter-9#exercises-8) - [**9\.10.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-9#conceptual-exercises-3) - [**9\.10.2** Applied exercises](https://www.bayesrulesbook.com/chapter-9#applied-exercises-1) - [**10** Evaluating Regression Models](https://www.bayesrulesbook.com/chapter-10) - [**10\.1** Is the model fair?](https://www.bayesrulesbook.com/chapter-10#is-the-model-fair) - [**10\.2** How wrong is the model?](https://www.bayesrulesbook.com/chapter-10#chapter-10-wrong-model) - [**10\.2.1** Checking the model assumptions](https://www.bayesrulesbook.com/chapter-10#checking-the-model-assumptions) - [**10\.2.2** Dealing with wrong models](https://www.bayesrulesbook.com/chapter-10#dealing-with-wrong-models) - [**10\.3** How accurate are the posterior predictive models?](https://www.bayesrulesbook.com/chapter-10#chapter-10-train-test) - [**10\.3.1** Posterior predictive summaries](https://www.bayesrulesbook.com/chapter-10#simple-summary-10) - [**10\.3.2** Cross-validation](https://www.bayesrulesbook.com/chapter-10#cross-validation) - [**10\.3.3** Expected log-predictive density](https://www.bayesrulesbook.com/chapter-10#chapter-10-elpd) - [**10\.3.4** Improving posterior predictive accuracy](https://www.bayesrulesbook.com/chapter-10#improving-posterior-predictive-accuracy) - [**10\.4** How good is the MCMC simulation vs how good is the model?](https://www.bayesrulesbook.com/chapter-10#how-good-is-the-mcmc-simulation-vs-how-good-is-the-model) - [**10\.5** Chapter summary](https://www.bayesrulesbook.com/chapter-10#chapter-summary-9) - [**10\.6** Exercises](https://www.bayesrulesbook.com/chapter-10#exercises-9) - [**10\.6.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-10#conceptual-exercises-4) - [**10\.6.2** Applied exercises](https://www.bayesrulesbook.com/chapter-10#applied-exercises-2) - [**10\.6.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-10#open-ended-exercises) - [**11** Extending the Normal Regression Model](https://www.bayesrulesbook.com/chapter-11) - [**11\.1** Utilizing a categorical predictor](https://www.bayesrulesbook.com/chapter-11#utilizing-a-categorical-predictor) - [**11\.1.1** Building the model](https://www.bayesrulesbook.com/chapter-11#building-the-model) - [**11\.1.2** Simulating the posterior](https://www.bayesrulesbook.com/chapter-11#simulating-the-posterior) - [**11\.2** Utilizing two predictors](https://www.bayesrulesbook.com/chapter-11#ch-11-2-predictors) - [**11\.2.1** Building the model](https://www.bayesrulesbook.com/chapter-11#building-the-model-1) - [**11\.2.2** Understanding the priors](https://www.bayesrulesbook.com/chapter-11#understanding-the-priors) - [**11\.2.3** Simulating the posterior](https://www.bayesrulesbook.com/chapter-11#simulating-the-posterior-1) - [**11\.2.4** Posterior prediction](https://www.bayesrulesbook.com/chapter-11#posterior-prediction) - [**11\.3** Optional: Utilizing interaction terms](https://www.bayesrulesbook.com/chapter-11#optional-utilizing-interaction-terms) - [**11\.3.1** Building the model](https://www.bayesrulesbook.com/chapter-11#building-the-model-2) - [**11\.3.2** Simulating the posterior](https://www.bayesrulesbook.com/chapter-11#simulating-the-posterior-2) - [**11\.3.3** Do you need an interaction term?](https://www.bayesrulesbook.com/chapter-11#do-you-need-an-interaction-term) - [**11\.4** Dreaming bigger: Utilizing more than 2 predictors\!](https://www.bayesrulesbook.com/chapter-11#ch11-more) - [**11\.5** Model evaluation & comparison](https://www.bayesrulesbook.com/chapter-11#ch11-model-comparison) - [**11\.5.1** Evaluating predictive accuracy using visualizations](https://www.bayesrulesbook.com/chapter-11#evaluating-predictive-accuracy-using-visualizations) - [**11\.5.2** Evaluating predictive accuracy using cross-validation](https://www.bayesrulesbook.com/chapter-11#evaluating-predictive-accuracy-using-cross-validation) - [**11\.5.3** Evaluating predictive accuracy using ELPD](https://www.bayesrulesbook.com/chapter-11#evaluating-predictive-accuracy-using-elpd) - [**11\.5.4** The bias-variance trade-off](https://www.bayesrulesbook.com/chapter-11#the-bias-variance-trade-off) - [**11\.6** Chapter summary](https://www.bayesrulesbook.com/chapter-11#chapter-summary-10) - [**11\.7** Exercises](https://www.bayesrulesbook.com/chapter-11#exercises-10) - [**11\.7.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-11#conceptual-exercises-5) - [**11\.7.2** Applied exercises](https://www.bayesrulesbook.com/chapter-11#applied-exercises-3) - [**11\.7.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-11#open-ended-exercises-1) - [**12** Poisson & Negative Binomial Regression](https://www.bayesrulesbook.com/chapter-12) - [**12\.1** Building the Poisson regression model](https://www.bayesrulesbook.com/chapter-12#building-the-poisson-regression-model) - [**12\.1.1** Specifying the data model](https://www.bayesrulesbook.com/chapter-12#specifying-the-data-model-1) - [**12\.1.2** Specifying the priors](https://www.bayesrulesbook.com/chapter-12#ch12-prior-spec) - [**12\.2** Simulating the posterior](https://www.bayesrulesbook.com/chapter-12#ch12-simulation) - [**12\.3** Interpreting the posterior](https://www.bayesrulesbook.com/chapter-12#ch12-interp-pois) - [**12\.4** Posterior prediction](https://www.bayesrulesbook.com/chapter-12#posterior-prediction-1) - [**12\.5** Model evaluation](https://www.bayesrulesbook.com/chapter-12#model-evaluation) - [**12\.6** Negative Binomial regression for overdispersed counts](https://www.bayesrulesbook.com/chapter-12#chapter-12-overdispersion) - [**12\.7** Generalized linear models: Building on the theme](https://www.bayesrulesbook.com/chapter-12#ch12-glm) - [**12\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-12#chapter-summary-11) - [**12\.9** Exercises](https://www.bayesrulesbook.com/chapter-12#exercises-11) - [**12\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-12#conceptual-exercises-6) - [**12\.9.2** Applied exercises](https://www.bayesrulesbook.com/chapter-12#applied-exercises-4) - [**13** Logistic Regression](https://www.bayesrulesbook.com/chapter-13) - [**13\.1** Pause: Odds & probability](https://www.bayesrulesbook.com/chapter-13#pause-odds-probability) - [**13\.2** Building the logistic regression model](https://www.bayesrulesbook.com/chapter-13#building-the-logistic-regression-model) - [**13\.2.1** Specifying the data model](https://www.bayesrulesbook.com/chapter-13#specifying-the-data-model-2) - [**13\.2.2** Specifying the priors](https://www.bayesrulesbook.com/chapter-13#specifying-the-priors-1) - [**13\.3** Simulating the posterior](https://www.bayesrulesbook.com/chapter-13#ch13-post-sim-sec) - [**13\.4** Prediction & classification](https://www.bayesrulesbook.com/chapter-13#chapter-13-prediction) - [**13\.5** Model evaluation](https://www.bayesrulesbook.com/chapter-13#model-evaluation-1) - [**13\.6** Extending the model](https://www.bayesrulesbook.com/chapter-13#extending-the-model) - [**13\.7** Chapter summary](https://www.bayesrulesbook.com/chapter-13#chapter-summary-12) - [**13\.8** Exercises](https://www.bayesrulesbook.com/chapter-13#exercises-12) - [**13\.8.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-13#conceptual-exercises-7) - [**13\.8.2** Applied exercises](https://www.bayesrulesbook.com/chapter-13#applied-exercises-5) - [**13\.8.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-13#open-ended-exercises-2) - [**14** Naive Bayes Classification](https://www.bayesrulesbook.com/chapter-14) - [**14\.1** Classifying one penguin](https://www.bayesrulesbook.com/chapter-14#naive-one-case) - [**14\.1.1** One categorical predictor](https://www.bayesrulesbook.com/chapter-14#one-categorical-predictor) - [**14\.1.2** One quantitative predictor](https://www.bayesrulesbook.com/chapter-14#naive-one-quant) - [**14\.1.3** Two predictors](https://www.bayesrulesbook.com/chapter-14#naive-two-quant) - [**14\.2** Implementing & evaluating naive Bayes classification](https://www.bayesrulesbook.com/chapter-14#implementing-evaluating-naive-bayes-classification) - [**14\.3** Naive Bayes vs logistic regression](https://www.bayesrulesbook.com/chapter-14#naive-bayes-vs-logistic-regression) - [**14\.4** Chapter summary](https://www.bayesrulesbook.com/chapter-14#chapter-summary-13) - [**14\.5** Exercises](https://www.bayesrulesbook.com/chapter-14#exercises-13) - [**14\.5.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-14#conceptual-exercises-8) - [**14\.5.2** Applied exercises](https://www.bayesrulesbook.com/chapter-14#applied-exercises-6) - [**14\.5.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-14#open-ended-exercises-3) - **IV Hierarchical Bayesian models** - [**15** Hierarchical Models are Exciting](https://www.bayesrulesbook.com/chapter-15) - [**15\.1** Complete pooling](https://www.bayesrulesbook.com/chapter-15#ch15-complete) - [**15\.2** No pooling](https://www.bayesrulesbook.com/chapter-15#no-pooling) - [**15\.3** Hierarchical data](https://www.bayesrulesbook.com/chapter-15#hierarchical-data) - [**15\.4** Partial pooling with hierarchical models](https://www.bayesrulesbook.com/chapter-15#partial-pooling-with-hierarchical-models) - [**15\.5** Chapter summary](https://www.bayesrulesbook.com/chapter-15#chapter-summary-14) - [**15\.6** Exercises](https://www.bayesrulesbook.com/chapter-15#exercises-14) - [**15\.6.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-15#conceptual-exercises-9) - [**15\.6.2** Applied exercises](https://www.bayesrulesbook.com/chapter-15#applied-exercises-7) - [**16** (Normal) Hierarchical Models without Predictors](https://www.bayesrulesbook.com/chapter-16) - [**16\.1** Complete pooled model](https://www.bayesrulesbook.com/chapter-16#chapter-16-complete-pooling) - [**16\.2** No pooled model](https://www.bayesrulesbook.com/chapter-16#chapter-16-no-pooling) - [**16\.3** Building the hierarchical model](https://www.bayesrulesbook.com/chapter-16#hierarchical-building-16) - [**16\.3.1** The hierarchy](https://www.bayesrulesbook.com/chapter-16#the-hierarchy) - [**16\.3.2** Another way to think about it](https://www.bayesrulesbook.com/chapter-16#another-way-to-think-about-it) - [**16\.3.3** Within- vs between-group variability](https://www.bayesrulesbook.com/chapter-16#ch16-within-btwn) - [**16\.4** Posterior analysis](https://www.bayesrulesbook.com/chapter-16#ch-16-analyze) - [**16\.4.1** Posterior simulation](https://www.bayesrulesbook.com/chapter-16#posterior-simulation-2) - [**16\.4.2** Posterior analysis of global parameters](https://www.bayesrulesbook.com/chapter-16#posterior-analysis-of-global-parameters) - [**16\.4.3** Posterior analysis of group-specific parameters](https://www.bayesrulesbook.com/chapter-16#posterior-analysis-of-group-specific-parameters) - [**16\.5** Posterior prediction](https://www.bayesrulesbook.com/chapter-16#ch16-prediction) - [**16\.6** Shrinkage & the bias-variance trade-off](https://www.bayesrulesbook.com/chapter-16#shrinkage-the-bias-variance-trade-off) - [**16\.7** Not everything is hierarchical](https://www.bayesrulesbook.com/chapter-16#ch-16-nonhierarchical) - [**16\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-16#chapter-summary-15) - [**16\.9** Exercises](https://www.bayesrulesbook.com/chapter-16#exercises-15) - [**16\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-16#conceptual-exercises-10) - [**16\.9.2** Applied exercises](https://www.bayesrulesbook.com/chapter-16#applied-exercises-8) - [**17** (Normal) Hierarchical Models with Predictors](https://www.bayesrulesbook.com/chapter-17) - [**17\.1** First steps: Complete pooling](https://www.bayesrulesbook.com/chapter-17#first-steps-complete-pooling) - [**17\.2** Hierarchical model with varying intercepts](https://www.bayesrulesbook.com/chapter-17#hierarchical-model-with-varying-intercepts) - [**17\.2.1** Model building](https://www.bayesrulesbook.com/chapter-17#model-building) - [**17\.2.2** Another way to think about it](https://www.bayesrulesbook.com/chapter-17#another-way-to-think-about-it-1) - [**17\.2.3** Tuning the prior](https://www.bayesrulesbook.com/chapter-17#tuning-the-prior) - [**17\.2.4** Posterior simulation & analysis](https://www.bayesrulesbook.com/chapter-17#chapter-17-random-intercepts) - [**17\.3** Hierarchical model with varying intercepts & slopes](https://www.bayesrulesbook.com/chapter-17#hierarchical-model-with-varying-intercepts-slopes) - [**17\.3.1** Model building](https://www.bayesrulesbook.com/chapter-17#model-building-1) - [**17\.3.2** Optional: The decomposition of covariance model](https://www.bayesrulesbook.com/chapter-17#optional-the-decomposition-of-covariance-model) - [**17\.3.3** Posterior simulation & analysis](https://www.bayesrulesbook.com/chapter-17#ch-17-rand-int-slope-sim) - [**17\.4** Model evaluation & selection](https://www.bayesrulesbook.com/chapter-17#model-evaluation-selection) - [**17\.5** Posterior prediction](https://www.bayesrulesbook.com/chapter-17#posterior-prediction-2) - [**17\.6** Details: Longitudinal data](https://www.bayesrulesbook.com/chapter-17#details-longitudinal-data) - [**17\.7** Example: Danceability](https://www.bayesrulesbook.com/chapter-17#example-danceability) - [**17\.8** Chapter summary](https://www.bayesrulesbook.com/chapter-17#chapter-summary-16) - [**17\.9** Exercises](https://www.bayesrulesbook.com/chapter-17#exercises-16) - [**17\.9.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-17#conceptual-exercises-11) - [**17\.9.2** Applied exercises](https://www.bayesrulesbook.com/chapter-17#applied-exercises-9) - [**17\.9.3** Open-ended exercises](https://www.bayesrulesbook.com/chapter-17#open-ended-exercises-4) - [**18** Non-Normal Hierarchical Regression & Classification](https://www.bayesrulesbook.com/chapter-18) - [**18\.1** Hierarchical logistic regression](https://www.bayesrulesbook.com/chapter-18#hierarchical-logistic-regression) - [**18\.1.1** Model building & simulation](https://www.bayesrulesbook.com/chapter-18#model-building-simulation) - [**18\.1.2** Posterior analysis](https://www.bayesrulesbook.com/chapter-18#posterior-analysis) - [**18\.1.3** Posterior classification](https://www.bayesrulesbook.com/chapter-18#posterior-classification) - [**18\.1.4** Model evaluation](https://www.bayesrulesbook.com/chapter-18#model-evaluation-2) - [**18\.2** Hierarchical Poisson & Negative Binomial regression](https://www.bayesrulesbook.com/chapter-18#hierarchical-poisson-negative-binomial-regression) - [**18\.2.1** Model building & simulation](https://www.bayesrulesbook.com/chapter-18#ch-18-rat-sim) - [**18\.2.2** Posterior analysis](https://www.bayesrulesbook.com/chapter-18#posterior-analysis-1) - [**18\.2.3** Model evaluation](https://www.bayesrulesbook.com/chapter-18#model-evaluation-3) - [**18\.3** Chapter summary](https://www.bayesrulesbook.com/chapter-18#chapter-summary-17) - [**18\.4** Exercises](https://www.bayesrulesbook.com/chapter-18#exercises-17) - [**18\.4.1** Applied & conceptual exercises](https://www.bayesrulesbook.com/chapter-18#applied-conceptual-exercises) - [**18\.4.2** Open-ended exercises](https://www.bayesrulesbook.com/chapter-18#open-ended-exercises-5) - [**19** Adding More Layers](https://www.bayesrulesbook.com/chapter-19) - [**19\.1** Group-level predictors](https://www.bayesrulesbook.com/chapter-19#group-level-predictors) - [**19\.1.1** A model using only individual-level predictors](https://www.bayesrulesbook.com/chapter-19#a-model-using-only-individual-level-predictors) - [**19\.1.2** Incorporating group-level predictors](https://www.bayesrulesbook.com/chapter-19#incorporating-group-level-predictors) - [**19\.1.3** Posterior simulation & global analysis](https://www.bayesrulesbook.com/chapter-19#posterior-simulation-global-analysis) - [**19\.1.4** Posterior group-level analysis](https://www.bayesrulesbook.com/chapter-19#posterior-group-level-analysis) - [**19\.1.5** We’re just scratching the surface\!](https://www.bayesrulesbook.com/chapter-19#were-just-scratching-the-surface) - [**19\.2** Incorporating two (or more!) grouping variables](https://www.bayesrulesbook.com/chapter-19#incorporating-two-or-more-grouping-variables) - [**19\.2.1** Data with two grouping variables](https://www.bayesrulesbook.com/chapter-19#data-with-two-grouping-variables) - [**19\.2.2** Building a model with two grouping variables](https://www.bayesrulesbook.com/chapter-19#building-a-model-with-two-grouping-variables) - [**19\.2.3** Simulating models with two grouping variables](https://www.bayesrulesbook.com/chapter-19#simulating-models-with-two-grouping-variables) - [**19\.2.4** Examining the group-specific parameters](https://www.bayesrulesbook.com/chapter-19#examining-the-group-specific-parameters) - [**19\.2.5** We’re just scratching the surface\!](https://www.bayesrulesbook.com/chapter-19#were-just-scratching-the-surface-1) - [**19\.3** Exercises](https://www.bayesrulesbook.com/chapter-19#exercises-18) - [**19\.3.1** Conceptual exercises](https://www.bayesrulesbook.com/chapter-19#conceptual-exercises-12) - [**19\.3.2** Applied exercises](https://www.bayesrulesbook.com/chapter-19#applied-exercises-10) - [**19\.4** Goodbye\!](https://www.bayesrulesbook.com/chapter-19#goodbye) - [References](https://www.bayesrulesbook.com/references) - [Published with bookdown](https://bookdown.org/) ## Bayes Rules! An Introduction to Applied Bayesian Modeling *Alicia A. Johnson, Miles Q. Ott, Mine Dogucu* *2021-12-01*
ML Classification
ML Categories
/Science
81.7%
/Science/Mathematics
76.6%
/Science/Mathematics/Statistics
76.1%
/Jobs_and_Education
13.6%
/Jobs_and_Education/Education
13.5%
Raw JSON
{
    "/Science": 817,
    "/Science/Mathematics": 766,
    "/Science/Mathematics/Statistics": 761,
    "/Jobs_and_Education": 136,
    "/Jobs_and_Education/Education": 135
}
ML Page Types
/Article
76.7%
/Article/Tutorial_or_Guide
73.5%
Raw JSON
{
    "/Article": 767,
    "/Article/Tutorial_or_Guide": 735
}
ML Intent Types
Informational
99.4%
Raw JSON
{
    "Informational": 994
}
Content Metadata
Languagenull
AuthorAlicia A. Johnson
Publish Time2021-12-01 00:00:00 (4 years ago)
Original Publish Time2020-10-07 22:13:58 (5 years ago)
RepublishedYes
Word Count (Total)1,446
Word Count (Content)1,388
Links
External Links3
Internal Links24
Technical SEO
Meta NofollowNo
Meta NoarchiveNo
JS RenderedNo
Redirect Targetnull
Performance
Download Time (ms)199
TTFB (ms)185
Download Size (bytes)9,923
Shard147 (laksa)
Root Hash17522205679125145147
Unparsed URLcom,bayesrulesbook!www,/ s443