using Random, StatsBase, Distributions using Graphs using AbstractMCMC: MCMCSerial #, MCMCThreads, MCMCDistributed using CairoMakie using Test using Revise using MultilevelChainSampler w = CyclicWalk() s = MetropolisHastings(w) f = LogDensity(x->-x^2/2) c = sample(f, s, 1000) #display(c) x = vcat(states(c)... ) @test abs(mean(x)) < 0.1 @test abs(std(x) - 0.539560) < 0.1 c = sample(f, s, MCMCSerial(), 100, 5) #display(c) x = hcat(states(c)...) @test abs(mean(x)) < 0.1 @test abs(std(x) - 0.539560) < 0.1