We compare our Turing implementation of the NPMH and NPLiftedMH samplers with Turing's built-in SMC sampler. Note that even through we have added a seed, Turing’s SMC implementation is not deterministic.
julia
from the command line to start a Julia interactive session (also known as a read-eval-print loop or "REPL").] add Turing, Random, Distributions, DataFrames, CSV, PlotlyJS
to install essential Julia packages for our implementation.Note that Turing's SMC implementation is nondeterministic, so its results may vary somewhat.
] activate NPMH
on the REPL to activate the NPMH package.include("infinite_gmm_npmh.jl")
on the REPL to sample from the infinite Gaussian mixture model using the SMC and NPMH samplers and store them in the data folder.] activate NPLiftedMH
on the REPL to activate the NPLiftedMH package.include("infinite_gmm_npmhp.jl")
on the REPL to sample from the infinite Gaussian mixture model using the NPLiftedMH sampler and store them in the data folder.include("visualise.jl")
on the REPL to plot the histogram of the posterior and store it in the images folder.