# Introduction to MCMC and Bayesian Regression via rstan

In this course, students learn how to apply Markov Chain Monte Carlo techniques (MCMC) to Bayesian statistical modeling using R and rstan.

## Overview

In this course, students learn how to apply Markov Chain Monte Carlo techniques (MCMC) to Bayesian statistical modeling using R and rstan. Topics covered include Gibbs sampling and the Metropolis-Hastings method. Participants also learn how to implement linear regression (normal and t errors), Poisson regression, binary/binomial regression, and ordinal regression.

• 4 Weeks
• Expert Instructor
• Tuiton-Back Guarantee
• 100% Online
• TA Support

## Learning Outcomes

Students who complete this course will learn how to apply Markov Chain Monte Carlo (MCMC) techniques using R and rstan. You will be introduced to coding for rstan and learn Bayesian methods for both linear  and discrete data regressions.

• Install rstan and write code in it
• Implement rstan programs in R
• Specify priors and likelihoods to define a model
• Implement a linear regression model in rstan
• Implement logistic, Poisson, ordinal and weighted regression in rstan

## Who Should Take This Course

Statisticians and analysts who need to build statistical models of data.

## Our Instructors

#### Dr. Peter Congdon

Dr. Peter Congdon is a Research Professor in Quantitative Geography and Health Statistics at Queen Mary University of London. He is the author of several books and numerous articles in peer-reviewed journals. His research interests include spatial data analysis, Bayesian statistics, latent variable models, and epidemiology.

## Course Syllabus

### Week 1

Using Markov Chain Monte Carlo

• Monte Carlo vs MCMC
• Estimating parameters and probabilities from complex models
• Sampling from random variables
• Gibbs sampling & full conditional densities
• Convergence
• Metropolis-Hastings method

### Week 2

Introduction to Coding for rstan and Running An Analysis

• Using rstan, coding principles
• R implementations of rstan programs
• Sampling from standard densities, distributional and target + options
• Specifying priors and likelihoods to define a model
• Posterior summaries

### Week 3

Bayesian Methods for Linear Regression

• Linear regression model in rstan
• Setting priors on regression coefficients and residual variances
• Extending the Normal linear model (outliers, heteroscedasticity)
• Shrinkage Priors

### Week 4

Bayesian Methods for Discrete Data Regression

• Logistic regression for binary and binomial responses; using other links
• Poisson regression
• Ordinal Regression
• Weighted regression

## Class Dates

### 2023

10/27/2023 to 11/24/2023
Instructors:

## Prerequisites

Participants should have had some exposure to Bayesian computing such as that provided in our Introduction to Bayesian Computing course, and familiarity with generalized linear models, such as that provided in Generalized Linear Models course.

### Introduction to Bayesian Computing and Techniques

This course will teach you how to apply Markov Chain Monte Carlo techniques (MCMC) to Bayesian statistical modeling using WinBUGS software.
• Credit Options: CAP, CEU

### Generalized Linear Models

This course will explain the theory of generalized linear models (GLM), outline the algorithms used for GLM estimation, and explain how to determine which algorithm to use for a given data analysis.
• Credit Options: CAP, CEU

## Register For This Course

Introduction to MCMC and Bayesian Regression via rstan

#### Homework

Homework in this course consists of short answer questions to test concepts and guided data analysis using software.

In addition to assigned readings, this course also has supplemental readings available online, end of course data modeling project, and example software codes.

#### Course Text

The required text for this course is  “Applied Bayesian Modelling”, 2nd edition, by Peter Congdon.

#### Software

Selected R programs will be used in week 1, but the primary program used will be the freeware rstan, which can be downloaded from the R-Project.

Though the R programs used in week 1 will not require a high degree of familiarity with R, if you want to continue to use R with the entire course, you should have some prior experience and facility with it.

#### Literacy, Accessibility, and Dyslexia

At Statistics.com, we aim to provide a learning environment suitable for everyone. To help you get the most out of your learning experience, we have researched and tested several assistance tools. For students with dyslexia, colorblindness, or reading difficulties, we recommend the following web browser add-ons and extensions:

Chrome

Firefox

Safari

• Navidys (for colorblindness, dyslexia, and reading difficulties)
• HelperBird for Safari (for colorblindness, dyslexia, and reading difficulties)

## Register For This Course

Introduction to MCMC and Bayesian Regression via rstan