@@ -20,6 +20,8 @@ export sample, MCMCThreads, MCMCDistributed, MCMCSerial
2020# Interfaces
2121abstract type AbstractSliceSampling <: AbstractMCMC.AbstractSampler end
2222
23+ const DEFAULT_MAX_PROPOSALS = 10_000
24+
2325"""
2426 struct Transition
2527
@@ -52,10 +54,9 @@ Return the initial sample for the `model` using the random number generator `rng
5254"""
5355function initial_sample (:: Random.AbstractRNG , :: Any )
5456 error (
55- " `initial_sample` is not implemented but an initialization wasn't provided. " *
57+ " `initial_sample` is not implemented but an initialization wasn't provided. " ,
5658 " Consider supplying an initialization to `initial_params`."
5759 )
58- println (" fuck!!!" )
5960end
6061
6162# If target is from `LogDensityProblemsAD`, unwrap target before calling `initial_sample`.
@@ -66,10 +67,15 @@ initial_sample(
6667) = initial_sample (rng, parent (wrap))
6768
6869function exceeded_max_prop (max_prop:: Int )
69- error (" Exceeded maximum number of proposal $(max_prop) .\n " ,
70- " Here are possible causes:\n " ,
71- " - The model might be broken or pathologic.\n " ,
72- " - There might be a bug in the sampler." )
70+ error (" Exceeded maximum number of proposal $(max_prop) , " ,
71+ " which indicates an acceptance rate less than $(1 / max_prop* 100 ) %. " ,
72+ " A quick fix is to increase `max_prop`, " ,
73+ " but an acceptance rate that is too low often indicates that there is a problem. " ,
74+ " Here are some possible causes:\n " ,
75+ " - The model might be broken or degenerate. (most likely cause)\n " ,
76+ " - The initialization is pathologic. (try supplying a different `initial_params`)\n " ,
77+ " - There might be a bug in the sampler. (if this is suspected, file an issue to `SliceSampling`)\n "
78+ )
7379end
7480
7581# # Univariate Slice Sampling Algorithms
0 commit comments