Skip to content

Commit 361a669

Browse files
devmotioncpfiffer
andauthored
Update README.md and reexport MCMCSerial (#66)
* Update README.md * Reexport MCMCSerial * Bump version * Update README.md Co-authored-by: Cameron Pfiffer <[email protected]> Co-authored-by: Cameron Pfiffer <[email protected]>
1 parent 465c22d commit 361a669

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "AdvancedMH"
22
uuid = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
3-
version = "0.6.5"
3+
version = "0.6.6"
44

55
[deps]
66
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,19 @@ rw_prop = RandomWalkProposal(Normal(0,1))
111111
Different methods are easily composeable. One parameter can be static and another can be a random walk,
112112
each of which may be drawn from separate distributions.
113113

114-
## Multithreaded sampling
114+
## Multiple chains
115115

116-
AdvancedMH.jl implements the interface of [AbstractMCMC](https://github.com/TuringLang/AbstractMCMC.jl/), which means you get multiple chain sampling
117-
in parallel for free:
116+
AdvancedMH.jl implements the interface of [AbstractMCMC](https://github.com/TuringLang/AbstractMCMC.jl/) which means sampling of multiple chains is supported for free:
118117

119118
```julia
120-
# Sample 4 chains from the posterior.
121-
chain = psample(model, RWMH(init_params), 100000, 4; param_names=["μ","σ"], chain_type=Chains)
119+
# Sample 4 chains from the posterior serially, without thread or process parallelism.
120+
chain = sample(model, RWMH(init_params), MCMCSerial(), 100000, 4; param_names=["μ","σ"], chain_type=Chains)
121+
122+
# Sample 4 chains from the posterior using multiple threads.
123+
chain = sample(model, RWMH(init_params), MCMCThreads(), 100000, 4; param_names=["μ","σ"], chain_type=Chains)
124+
125+
# Sample 4 chains from the posterior using multiple processes.
126+
chain = sample(model, RWMH(init_params), MCMCDistributed(), 100000, 4; param_names=["μ","σ"], chain_type=Chains)
122127
```
123128

124129
## Metropolis-adjusted Langevin algorithm (MALA)

src/AdvancedMH.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export
2222
MALA
2323

2424
# Reexports
25-
export sample, MCMCThreads, MCMCDistributed
25+
export sample, MCMCThreads, MCMCDistributed, MCMCSerial
2626

2727
# Abstract type for MH-style samplers. Needs better name?
2828
abstract type MHSampler <: AbstractMCMC.AbstractSampler end

0 commit comments

Comments
 (0)