You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/api.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,18 +71,24 @@ Common keyword arguments for regular and parallel sampling are:
71
71
-`progress` (default: `AbstractMCMC.PROGRESS[]` which is `true` initially): toggles progress logging
72
72
-`chain_type` (default: `Any`): determines the type of the returned chain
73
73
-`callback` (default: `nothing`): if `callback !== nothing`, then
74
-
`callback(rng, model, sampler, sample, state, iteration)` is called after every sampling step,
75
-
where `sample` is the most recent sample of the Markov chain and `state` and `iteration` are the current state and iteration of the sampler
76
-
-`discard_initial` (default: `0`): number of initial samples that are discarded
74
+
`callback(rng, model, sampler, sample, iteration)` is called after every sampling step,
75
+
where `sample` is the most recent sample of the Markov chain and `iteration` is the current iteration
76
+
-`num_warmup` (default: `0`): number of "warm-up" steps to take before the first "regular" step,
77
+
i.e. number of times to call [`AbstractMCMC.step_warmup`](@ref) before the first call to
78
+
[`AbstractMCMC.step`](@ref).
79
+
-`discard_initial` (default: `num_warmup`): number of initial samples that are discarded. Note that
80
+
if `discard_initial < num_warmup`, warm-up samples will also be included in the resulting samples.
77
81
-`thinning` (default: `1`): factor by which to thin samples.
82
+
-`initial_state` (default: `nothing`): if `initial_state !== nothing`, the first call to [`AbstractMCMC.step`](@ref)
83
+
is passed `initial_state` as the `state` argument.
78
84
79
85
!!! info
80
86
The common keyword arguments `progress`, `chain_type`, and `callback` are not supported by the iterator [`AbstractMCMC.steps`](@ref) and the transducer [`AbstractMCMC.Sample`](@ref).
81
87
82
88
There is no "official" way for providing initial parameter values yet.
83
-
However, multiple packages such as [EllipticalSliceSampling.jl](https://github.com/TuringLang/EllipticalSliceSampling.jl) and [AdvancedMH.jl](https://github.com/TuringLang/AdvancedMH.jl) support an `init_params` keyword argument for setting the initial values when sampling a single chain.
84
-
To ensure that sampling multiple chains "just works" when sampling of a single chain is implemented, [we decided to support `init_params` in the default implementations of the ensemble methods](https://github.com/TuringLang/AbstractMCMC.jl/pull/94):
85
-
-`init_params` (default: `nothing`): if `init_params isa AbstractArray`, then the `i`th element of `init_params` is used as initial parameters of the `i`th chain. If one wants to use the same initial parameters `x` for every chain, one can specify e.g. `init_params = FillArrays.Fill(x, N)`.
89
+
However, multiple packages such as [EllipticalSliceSampling.jl](https://github.com/TuringLang/EllipticalSliceSampling.jl) and [AdvancedMH.jl](https://github.com/TuringLang/AdvancedMH.jl) support an `initial_params` keyword argument for setting the initial values when sampling a single chain.
90
+
To ensure that sampling multiple chains "just works" when sampling of a single chain is implemented, [we decided to support `initial_params` in the default implementations of the ensemble methods](https://github.com/TuringLang/AbstractMCMC.jl/pull/94):
91
+
-`initial_params` (default: `nothing`): if `initial_params isa AbstractArray`, then the `i`th element of `initial_params` is used as initial parameters of the `i`th chain. If one wants to use the same initial parameters `x` for every chain, one can specify e.g. `initial_params = FillArrays.Fill(x, N)`.
86
92
87
93
Progress logging can be enabled and disabled globally with `AbstractMCMC.setprogress!(progress)`.
Base.Experimental.register_error_hint(MethodError) do io, exc, argtypes, _
114
+
if Base.parentmodule(exc.f) == LogDensityProblems &&
115
+
any(a -> a <:LogDensityModel, argtypes)
116
+
print(
117
+
io,
118
+
"\n`AbstractMCMC.LogDensityModel` is a wrapper and does not itself implement the LogDensityProblems.jl interface. To use LogDensityProblems.jl methods, access the inner type with (e.g.) `logdensity(model.logdensity, params)` instead of `logdensity(model, params)`.",
0 commit comments