Skip to content

MCMC proposal outside prior raises FloatingPointError and kills sampler #12

@astrolamb

Description

@astrolamb

On line 6 of runQuickMCMC.py, there's a line that changes the default behaviour of numpy when 0.0 is input into np.log. The default behaviour is a warning. Line 6 changes the bevaiour to raising a FloatingPointError. This causes an error when an MCMC iteration proposes a value outside of a prior. Instead of assigning a logpdf of -np.inf, as expected of an MCMC sampler, it just kills the sampler.

np.seterr(all='raise')

I see that there are similar lines of code throughout QuickCW that have been commented out. I assume this line should've also have been commented out?

I raise this because it was a source of confusion for a student who thought it was actually an enterprise problem initially.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions