Skip to content

MH implementation not ergodic on certain models #72

@nalourie

Description

@nalourie

Because the implementation of MH updates the random variables one at a time, the resulting chain is not ergodic for certain models and thus doesn't actually sample from the posterior distribution. Example:

(mh-query 100 100
  (define bools (list (flip) (flip)))
  bools
  (not (equal? bools (list true false))
         (equal? bools (list false true))) ;; -> will return samples only from either '(#t #t) or '(#f #f)

I ran this code on the probabilistic models of cognition book's website.

My quick suggestion for a fix: do a full state transition (every dimension) regularly in the beginning, then once you have an estimate for how many "components" the markov chain has, you can decide how often you want to do a full state transition after that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions