diff --git a/src/inference/mh.jl b/src/inference/mh.jl index acb0dd98b..e0517c9b2 100644 --- a/src/inference/mh.jl +++ b/src/inference/mh.jl @@ -146,7 +146,7 @@ function assume(spl::Sampler{<:MH}, dist::Distribution, vn::VarName, vi::VarInfo spl.state.proposal_ratio -= log(cdf(stdG, (ub-r)/σ) - cdf(stdG,(lb-r)/σ)) else # Other than Gaussian proposal r = rand(proposal) - if (r < support(dist).lb) | (r > support(dist).ub) # check if value lies in support + if !(insupport(dist, r)) # check if value lies in support spl.state.violating_support = true r = old_val end diff --git a/src/interface/Interface.jl b/src/interface/Interface.jl index c0bc494ac..8f2ecb997 100644 --- a/src/interface/Interface.jl +++ b/src/interface/Interface.jl @@ -215,7 +215,7 @@ end ) Performs whatever initial setup is required for your sampler. This function is not intended -to return any value -- any set up should utate the sampler or the model type in-place. +to return any value -- any set up should mutate the sampler or the model type in-place. A common use for `sample_init!` might be to instantiate a particle field for later use, or find an initial step size for a Hamiltonian sampler. @@ -244,7 +244,7 @@ end ) Performs whatever finalizing the sampler requires. This function is not intended -to return any value -- any set up should utate the sampler or the model type in-place. +to return any value -- any set up should mutate the sampler or the model type in-place. `sample_end!` is useful in cases where you might like to perform some transformation on your vector of `AbstractTransitions`, save your sampler struct to disk, or otherwise diff --git a/src/utilities/Utilities.jl b/src/utilities/Utilities.jl index 2d3cda454..fc70a103b 100644 --- a/src/utilities/Utilities.jl +++ b/src/utilities/Utilities.jl @@ -17,6 +17,5 @@ export vectorize, include("helper.jl") include("robustinit.jl") -include("io.jl") # I/O end # module