betanalpha / knitr_case_studies

Inference case studies in knitr
163 stars 94 forks source link

Typo in Metropolis-Hastings conditional PDF #27

Closed siddhantwahal closed 4 years ago

siddhantwahal commented 4 years ago

Hi!

I think the Metropolis-Hastings conditional PDF in markov_chain_monte_carlo.Rmd should be:

$$
T(q' \mid q) = a(q', q) \cdot Q (q' \mid q )
+ \left(1 - \int a(q, q') Q(q' \mid q) d q' \right) \cdot \delta(q - q').
$$

instead of


$$
T(q' \mid q) = a(q', q) \cdot Q (q' \mid q )
+ \left(1 - a(q, q') \right) \cdot \delta(q - q').
$$

Else, the conditional PDF T(q' | q) doesn't integrate to 1. See, for instance, pg 3 of this note.

Great work by the way! I found the bit on correctly estimating the maximum lag for the autocorrelation very useful.

betanalpha commented 4 years ago

Yes, thanks! I always forget the integral on rejection probability unless I’m working out the derivation in full. I’ll include a correction when I get to updating the case study next.

On Jan 13, 2020, at 2:40 PM, siddhantwahal notifications@github.com wrote:

Hi!

I think the Metropolis-Hastings conditional PDF should be:

$$ T(q' \mid q) = a(q', q) \cdot Q (q' \mid q )

\left(1 - \int a(q, q') Q(q' \mid q) d q' \right) \cdot \delta(q - q'). $$ instead of

$$ T(q' \mid q) = a(q', q) \cdot Q (q' \mid q )

\left(1 - a(q, q') \right) \cdot \delta(q - q'). $$ Else, the conditional PDF T(q' | q) doesn't integrate to 1. See, for instance, pg 3 of this [note].(https://ocw.mit.edu/courses/economics/14-384-time-series-analysis-fall-2013/lecture-notes/MIT14_384F13_lec25.pdf https://ocw.mit.edu/courses/economics/14-384-time-series-analysis-fall-2013/lecture-notes/MIT14_384F13_lec25.pdf).

Great work by the way! I found the bit on correctly estimating the maximum lag for the autocorrelation very useful.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/betanalpha/knitr_case_studies/issues/27?email_source=notifications&email_token=AALU3FQOU7IDXGHBGL5MVN3Q5S7TXA5CNFSM4KGHW6U2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IF3GWQQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALU3FSLHWJSUAJAZAOVGBDQ5S7TXANCNFSM4KGHW6UQ.