monte carlo and empirical methods for stochastic inference ...€¦ · last time: introduction to...

31
Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Monte Carlo and Empirical Methods for Stochastic Inference (MASM11/FMSN50) Magnus Wiktorsson Centre for Mathematical Sciences Lund University, Sweden Lecture 9 Markov chain Monte Carlo II February 13, 2018 M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 1 / 31

Upload: others

Post on 20-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Monte Carlo and Empirical Methods for StochasticInference (MASM11/FMSN50)

Magnus WiktorssonCentre for Mathematical Sciences

Lund University, Sweden

Lecture 9Markov chain Monte Carlo II

February 13, 2018

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (1) 1 / 31

Page 2: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Plan of today’s lecture

1 Last time: Introduction to MCMC

2 The Metropolis-Hastings algorithm (Ch. 5.3)

3 Comments on HA 1

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (2) 2 / 31

Page 3: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

We are here −→ •

1 Last time: Introduction to MCMC

2 The Metropolis-Hastings algorithm (Ch. 5.3)

3 Comments on HA 1

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (3) 3 / 31

Page 4: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Markov Chain Monte Carlo (MCMC)

Basic idea: To sample from a density f we construct a Markov chainhaving f as stationary distribution. A law of large numbers for Markovchains guarantees convergence.If f is complicated and/or high dimensional this is often easier thantransformation methods and rejection sampling.The price is it that samples will be statistically dependent.MCMC is currently the most common method for sampling fromcomplicated and/or high dimensional distributions.Dates back to the 1950’s with two key papers being

Equations of state calculations by fast computing machines (Metropoliset al., 1953) andMonte Carlo sampling methods using Markov chains and theirapplications (Hastings, 1970).

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (4) 4 / 31

Page 5: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Last time: Stationary Markov chains

We called a distribution π(x) stationary if∫q(x|z)π(z)dz = π(x). (Global balance)

For a stationary distribution π it holds that

χ = π ⇒ f(xn) = π(xn), ∀n.

Thus, if the chain starts in the stationary distribution, it will always stay inthe stationary distribution. In this case we call also the chain stationary.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (5) 5 / 31

Page 6: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Local balance

Let (Xk) have transition density q and let λ(x) be a distribution satisfyingthe local balance condition

λ(x)q(z|x) = λ(z)q(x|z), ∀x, z ∈ X.

Interpretation:

“flow” from state x→ z = “flow” from state z → x.

Then the following holds.

TheoremAssume that λ satisfies local balance. Then λ is a stationary distribution.

The converse is not true in general.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (6) 6 / 31

Page 7: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Ergodic Markov chains

A Markov chain (Xn) with stationary distribution π is called ergodic if forall initial distributions χ,

supA⊆X|P(Xn ∈ A)− π(A)| → 0, as n→∞.

Theorem (Geometric ergodicity)

Assume that there exists a density µ(x) and a constant ε > 0 such that forall x, z ∈ X,

q(z|x) ≥ εµ(z). (∗)

Then the chain (Xn) is geometrically ergodic, i.e. there is a ρ < 1 suchthat for all χ,

supA⊆X|P(Xn ∈ A)− π(A)| ≤ ρn.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (7) 7 / 31

Page 8: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Example: a chain on a discrete set

Let X = {1, 2, 3} and q(1|1) = 0.4 q(2|1) = 0.4 q(3|1) = 0.2q(1|2) = 0 q(2|2) = 0.7 q(3|2) = 0.3q(1|3) = 0 q(2|3) = 0.1 q(3|3) = 0.9

.

This chain has π = (0, 0.25, 0.75) as stationary distribution (check globalbalance). Moreover, the chain satisfies (∗) with

ε = 0.3 and µ = (0, 1/3, 2/3).

It is thus geometrically ergodic.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (8) 8 / 31

Page 9: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Example: a chain on a discrete set

Estimated correlation obtained by simulating the chain 1000 time steps:

0 2 4 6 8 10 12 14 16 18 20−0.2

0

0.2

0.4

0.6

0.8

1

1.2

Time lag

Estimated correlation

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (9) 9 / 31

Page 10: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

A law of large numbers for Markov chains

In the case when (Xn) is geometrically ergodic, the states are only weaklydependent. For such Markov chains there is, just like in the case ofindependent variables, a law of large numbers (LLN):

Theorem (Law of large numbers for Markov chains)

Let (Xn) be a stationary Markov chain. Denote by π the stationarydistribution. In addition, assume that

∞∑k=1

|C (φ(X1), φ(Xk))| <∞. (∗∗)

Then for all ε > 0,

P

(∣∣∣∣∣ 1nn∑

k=1

φ(Xk)−∫Xφ(x)π(x) dx

∣∣∣∣∣ > ε

)→ 0 as n→∞.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (10) 10 / 31

Page 11: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Proof of LLN (helping Lemma)

Lemma (Chebyshev’s inequality)

Let Z ≥ 0 be a r.v. with EZ2 <∞ then

P(Z > ε) ≤ E[Z2]

ε2.

Proof.

P(Z > ε) = E[I(Z > ε)] ≤ E

[(Z

ε

)2

I(Z > ε)

]

≤ E

[(Z

ε

)2]=

E[Z2]

ε2

2

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (11) 11 / 31

Page 12: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

A law of large numbers for Markov chains (cont.)

In the theorem above,the condition (∗∗) is often satisfied for geometrically ergodic Markovchains for which the dependence between states decreasesgeometrically fast.the condition (∗∗) can be weakened considerably (it is however neededfor the corresponding CLT; see next lecture).the convergence type is called convergence in probability and onetypically writes

1

n

n∑k=1

φ(Xk)P→∫Xφ(x)π(x) dx as n→∞.

It is possible to extend the LLN to stronger types of convergence, suchas convergence a.s.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (12) 12 / 31

Page 13: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

We are here −→ •

1 Last time: Introduction to MCMC

2 The Metropolis-Hastings algorithm (Ch. 5.3)

3 Comments on HA 1

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (13) 13 / 31

Page 14: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

The principle of MCMC

The LLN for Markov chains makes it possible to estimate expectations

τ = E(φ(X)) =

∫Xφ(x)f(x) dx

by simulating, N steps, a Markov chain (Xk) with stationary distribution fand letting

τN =1

N

N∑k=1

φ(Xk)→ τ as N →∞.

This is the principle of all MCMC methods.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (14) 14 / 31

Page 15: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

To make this idea practicable requires simulation schemes that guaranteethat simulating the chain (Xk) is an easily implementable processthat the stationary distribution of (Xk) indeed coincides with thedesired distribution f .that the chain (Xk) converges towards f irrespectively of the initialvalue X1.

We will now discuss two major classes of such algorithms, namely theMetropolis-Hastings algorithm and the Gibbs sampler.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (15) 15 / 31

Page 16: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

The Metropolis-Hastings (MH) algorithm

In the following we assume that we can simulate from a transition densityr(z|x), referred to as the proposal kernel, on X.

The MH algorithm simulates a sequence of values (Xk), forming a Markovchain on X, through the following mechanism: given Xk,

generate X∗ ∼ r(z|Xk) andset

Xk+1 =

X∗ w. pr. α(Xk, X∗)

def= 1 ∧ f(X

∗)r(Xk|X∗)f(Xk)r(X∗|Xk)

,

Xk otherwise.

Here we used the notation a ∧ b def= min{a, b}. The scheme is initialized by

drawing X1 from some initial distribution χ.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (16) 16 / 31

Page 17: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

The MH algorithm: Pseudo-code

draw X1 ∼ χfor k = 1→ (N − 1) do

draw X∗ ∼ r(z|Xk)

set α(Xk, X∗)← 1 ∧ f(X∗)r(Xk|X∗)

f(Xk)r(X∗|Xk)

draw U ∼ U(0, 1)if U ≤ α thenXk+1 ← X∗

elseXk+1 = Xk

end ifend forset τN ←

∑Nk=1 φ(Xk)/N

return τN

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (17) 17 / 31

Page 18: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

A look at α(Xk, X∗)

Recall thatα(Xk, X

∗) = 1 ∧ f(X∗)r(Xk|X∗)

f(Xk)r(X∗|Xk)

is the probability of accepting the new state X∗ given the old state Xk.

First, ignore the transition kernel r. Thenthe ratio f(X∗)/f(Xk) says: accept (keep) the proposed state X∗ ifit is “better” than the old state Xk (as measured by f);otherwise, if the proposed state is “worse” than the old one, accept itwith a probability proportional to how much worse.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (18) 18 / 31

Page 19: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

A look at α(Xk, X∗)

Recall again

α(Xk, X∗) = 1 ∧ f(X

∗)r(Xk|X∗)f(Xk)r(X∗|Xk)

.

At the same time we also want to explore the state space, where somestates may be easier to reach than others. This is compensated for by thefactor r(Xk|X∗)/r(X∗|Xk).

If it is easy to reach X∗ from Xk, the denominator r(X∗|Xk) willreduce the acceptance probability;if it is easy to get back to Xk from X∗, the numerator r(Xk|X∗) willincrease the acceptance probability.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (19) 19 / 31

Page 20: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Convergence of the MH algorithm

The following result is fundamental.

Theorem (Global balance of the MH sampler)

The chain (Xk) generated by the MH sampler has f as stationarydistribution.

In addition, one may prove, under weak assumptions, that the MHalgorithm is also geometrically ergodic, implying that, as N →∞,

τN =1

N

N∑k=1

φ(Xk)→ τ =

∫φ(x)f(x) dx.

Given some starting value X1, there will be, say, B iterations before thedistribution of the chain can be considered as “sufficiently close” to thestationary distribution. The values (Xk)

Bk=1 are referred to as burn-in and

are typically discarded in the analysis.M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (20) 20 / 31

Page 21: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

different types of proposal kernels

There are a number of different ways of constructing the proposal kernel r.The three main classes are

independent proposals,symmetric proposals, andmultiplicative proposals.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (21) 21 / 31

Page 22: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Independent proposal

Independent proposals are characterized as follows.Draw the candidates from r(z), i.e. independently of the current statex.The acceptance probability reduces to

α(x, z) = 1 ∧ f(z)r(x)f(x)r(z)

.

Here it is required that {x : f(x) > 0} ⊆ {x : r(x) > 0} to ensureconvergence.If we take r(x) = f(x), which is of course infeasible in general, theacceptance probability reduces to 1 and we get independent samplesfrom f .

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (22) 22 / 31

Page 23: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Symmetric proposal

Symmetric proposals are characterized by the following.It holds that r(z|x) = r(x|z), ∀(x, z) ∈ X2.In this case the acceptance probability reduces to

α(x, y) = 1 ∧ f(z)f(x)

.

Commonly this corresponds to X∗ = Xk + ε (random walk proposal)with, e.g.,

ε ∈ N (0, σ2) orε ∈ U(−a, a).

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (23) 23 / 31

Page 24: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Multiplicative proposals

An easy way to obtain an asymmetric proposal where the size of the jumpdepends on the current state Xk = x is to take

X∗ = xε,

where ε is drawn from some density p.

The proposal kernel now becomes r(z|x) = p(z/x)/x and the acceptanceprobability becomes

α(x, z) = 1 ∧ f(z)p(x/z)/zf(x)p(z/x)/x

.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (24) 24 / 31

Page 25: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Example: a tricky integral

Since the target density f enters the acceptance probability α(x, z) onlyvia the ratio f(z)/f(x), we only need to know f up to a normalizingconstant (cf. rejection sampling). This is one of the main strengths of theMH sampler.

As an example we estimate the variance τ = E(X2) under

f(x) = exp(cos2(x))/c, x ∈ (−π/2, π/2),

where c > 0 is unknown, using the MH algorithm.

We propose new candidates according to a simple symmetric random walkinitialized in the origin, i.e.

r(z|x) = N (z;x, σ2)

and X1 = 0.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (25) 25 / 31

Page 26: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Example: a tricky integral (cont.)

In Matlab:

z = @(x) exp(cos(x).^2).*(x > −pi/2).*(x < pi/2);burn_in = 2000;M = N + burn_inX = zeros(1,M);X(1) = 0;for k = 1:(M − 1),

cand = X(k) + randn*sigma;alpha = z(cand)/z(X(k));if rand <= alpha,

X(k + 1) = cand;else

X(k + 1) = X(k);end

endtau = mean(X(burn_in:M).^2);

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (26) 26 / 31

Page 27: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Example: a tricky integral (cont.)

Comparison between the true density and the histogram of Xk,k = 2001, . . . , 22000.

−2 −1.5 −1 −0.5 0 0.5 1 1.5 20

0.1

0.2

0.3

0.4

0.5

0.6

0.7Normalized histogram of Markov chain sample

Values

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (27) 27 / 31

Page 28: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Example:a tricky integral (cont.)

MH output (τN ) for increasing N (blue) and true value (red):

0 2 4 6 8 10 12 14

x 104

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7MH trajectory

Numer of iterations (N)

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (28) 28 / 31

Page 29: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

We are here −→ •

1 Last time: Introduction to MCMC

2 The Metropolis-Hastings algorithm (Ch. 5.3)

3 Comments on HA 1

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (29) 29 / 31

Page 30: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

A few comments on HA 1

Always provide numerical values (not only figures), preferably in atable.Focus on describing precisely how you obtained your results ratherthan on describing the general theory. But be concise!Analyze your results.A figure caption cannot almost never be too long!Check your importance weights properly!

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (30) 30 / 31

Page 31: Monte Carlo and Empirical Methods for Stochastic Inference ...€¦ · Last time: Introduction to MCMC The Metropolis-Hastings algorithm (Ch. 5.3) Comments on HA 1 Planoftoday’slecture

Last time: Introduction to MCMCThe Metropolis-Hastings algorithm (Ch. 5.3)

Comments on HA 1

Next time

Next time we willprove the global balance theorem above andmove on to the Gibbs sampler.

M. Wiktorsson Monte Carlo and Empirical Methods for Stochastic Inference, L9 (31) 31 / 31