@@ -20,6 +20,8 @@ export sample, MCMCThreads, MCMCDistributed, MCMCSerial
20
20
# Interfaces
21
21
abstract type AbstractSliceSampling <: AbstractMCMC.AbstractSampler end
22
22
23
+ const DEFAULT_MAX_PROPOSALS = 10_000
24
+
23
25
"""
24
26
struct Transition
25
27
@@ -52,10 +54,9 @@ Return the initial sample for the `model` using the random number generator `rng
52
54
"""
53
55
function initial_sample (:: Random.AbstractRNG , :: Any )
54
56
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. " ,
56
58
" Consider supplying an initialization to `initial_params`."
57
59
)
58
- println (" fuck!!!" )
59
60
end
60
61
61
62
# If target is from `LogDensityProblemsAD`, unwrap target before calling `initial_sample`.
@@ -66,10 +67,15 @@ initial_sample(
66
67
) = initial_sample (rng, parent (wrap))
67
68
68
69
function 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
+ )
73
79
end
74
80
75
81
# # Univariate Slice Sampling Algorithms
0 commit comments