An Overview of Bayesian Econometrics
An Overview of Bayesian Econometrics
() Bayesian Overview 1 / 30
Bayesian Theory
() Bayesian Overview 2 / 30
Let A and B be two events, p (B jA) is the conditional probability of
B jA. “summarizes what is known about B given A”
Bayesians use this rule with A = something known or assumed (e.g.
the Data), B is something unknown (e.g. coe¢ cients in a model).
Let y be data, y be unobserved data (i.e. to be forecast), Mi for
i = 1, .., m be set of models each of which depends on some
parameters, θ i .
Learning about parameters in a model is based on the posterior
density: p (θ i jMi , y )
Model comparison based on posterior model probability: p (Mi jy )
Prediction based on the predictive density p (y jy ).
() Bayesian Overview 3 / 30
Bayes Theorem
() Bayesian Overview 4 / 30
These two rules can be combined to yield Bayes’Theorem:
Pr (AjB ) Pr (B )
Pr (B jA) = .
Pr (A)
() Bayesian Overview 5 / 30
Learning About Parameters in a Given Model (Estimation)
p (AjB )p (B )
p (B jA) = .
p (A)
p (y j θ )p ( θ )
p ( θ jy ) = .
p (y )
() Bayesian Overview 6 / 30
Bayesians treat p (θ jy ) as being of fundamental interest: “Given the
data, what do we know about θ?”.
Treatment of θ as a random variable is controversial among some
econometricians.
Competitor to Bayesian econometrics, called frequentist econometrics,
says that θ is not a random variable.
For estimation can ignore the term p (y ) since it does not involve θ:
p ( θ jy ) ∝ p (y j θ )p ( θ ).
() Bayesian Overview 7 / 30
p (θ ), does not depend on the data. It contains any non-data
information available about θ.
Prior information is controversial aspect since it sounds unscienti…c.
Bayesian answers (to be elaborated on later):
i) Often we do have prior information and, if so, we should include it
(more information is good)
ii) Can work with “noninformative” priors
iii) Can use “empirical Bayes” methods which estimate prior from the
data
iv) Training sample priors
v) Bayesian estimators often have better frequentist properties than
frequentist estimators (e.g. results due to Stein show MLE is
inadmissible – but Bayes estimators are admissible)
vi) Prior sensitivity analysis
() Bayesian Overview 8 / 30
Prediction in a Single Model
() Bayesian Overview 9 / 30
Model Comparison (Hypothesis testing)
p (y jMi )p (Mi )
p ( Mi j y ) =
p (y )
() Bayesian Overview 10 / 30
How is marginal likelihood calculated?
Posterior can be written as:
p (y jθ i , Mi )p (θ i jMi )
p (θ i jy , Mi ) =
p (y jMi )
Integrate
R both sides with respect to θ i , use fact that
p (θ i jy , Mi )d θ i = 1 and rearrange:
Z
p (y jMi ) = p (y jθ i , Mi )p (θ i jMi )d θ i .
() Bayesian Overview 11 / 30
Posterior odds ratio compares two models:
p ( Mi j y ) p (y jMi )p (Mi )
POij = = .
p (Mj jy ) p (y jMj )p (Mj )
Note: p (y ) is common to both models, no need to calculate.
Can use fact that p (M1 jy ) + p (M2 jy ) + ... + p (Mm jy ) = 1 and POij
to calculate the posterior model probabilities.
E.g. if m = 2 models:
p (M1 jy ) + p (M2 jy ) = 1
p (M1 jy )
PO12 =
p (M2 jy )
imply
PO12
p (M1 jy ) =
1 + PO12
p (M2 jy ) = 1 p (M1 jy ).
The Bayes Factor is:
p (y jMi )
BFij = .
p (y jMj )
() Bayesian Overview 12 / 30
Example: Deriving Posterior When Data Has Bernoulli
Distribution
() Bayesian Overview 13 / 30
Example (cont.): The Bernoulli Likelihood function
θ if yt = 1
p (yt jθ ) =
1 θ if yt = 0.
() Bayesian Overview 14 / 30
Example (cont.): The Beta Prior
() Bayesian Overview 15 / 30
Example (cont.): Eliciting a Prior
() Bayesian Overview 16 / 30
Example (cont.): A Noninformative Prior
() Bayesian Overview 17 / 30
Example (cont.): Deriving the Posterior
1 1
= θα (1 θ )δ
where
α = α+m
δ = δ+T m
() Bayesian Overview 18 / 30
Example (cont.): Interpretation and Terminology
() Bayesian Overview 19 / 30
Example (cont.): Predictive Density
() Bayesian Overview 20 / 30
Summary
These few pages have outlined all the basic theoretical concepts
required for the Bayesian to learn about parameters, compare models
and predict.
This is an enormous advantage: Once you accept that unknown
things (i.e. θ, Mi and y ) are random variables, the rest of Bayesian
approach is non-controversial.
What are going to do in rest of this course?
See how these concepts work in some models of interest.
First the regression model
Then time series models of interest for macroeconomics
Bayesian computation.
() Bayesian Overview 21 / 30
Bayesian Computation
() Bayesian Overview 22 / 30
Aside De…nition B.8: Expected Value
Let g () be a function, then the expected value of g (X ), denoted
E [g (X )], is de…ned by:
N
E [g (X )] = ∑ g (xi ) p (xi )
i =1
() Bayesian Overview 23 / 30
Common measure of dispersion is the posterior standard deviation
(square root of posterior variance)
Posterior variance:
var (θ i jy ) = E (θ 2i jy ) fE (θ i jy )g2 ,
() Bayesian Overview 24 / 30
All of these posterior features have the form:
Z
E [g ( θ ) jy ] = g (θ )p (θ jy )d θ,
() Bayesian Overview 25 / 30
Posterior Simulation
() Bayesian Overview 26 / 30
Example: Monte Carlo integration.
Let θ (s ) for s = 1, .., S be a random sample from p (θ jy ) and de…ne
S
1
gbS =
S ∑g θ (s ) ,
s =1
() Bayesian Overview 27 / 30
Most Bayesians write own programs (e.g. using Matlab, Julia,
Python, Gauss, R or C++) to do posterior simulation
Bayesian work cannot (easily) be done in standard econometric
packages like Micro…t, Eviews or Stata.
New Stata has some Bayes, but limited (and little for
macroeconomics)
I have a Matlab website for VARs, TVP-VARs and TVP-FAVARs (see
my website)
Dimitris Korobilis:
https://sites.google.com/site/dimitriskorobilis/matlab
Joshua Chan: http://joshuachan.org/
Haroon Mumtaz: https://sites.google.com/site/hmumtaz77/
Many more using R see
http://cran.r-project.org/web/views/Bayesian.html
() Bayesian Overview 28 / 30
Learning Outside of Lectures
() Bayesian Overview 29 / 30
Learning Outside of Lectures