Skip to content

Gibbs / dynamic model / PG + ESS reproducibility #2626

@penelopeysm

Description

@penelopeysm

Minimal working example

using Turing, Random

@model function dynamic_model_for_ess()
    b ~ Bernoulli()
    x_length = b ? 1 : 2
    x = Vector{Float64}(undef, x_length)
    for i in 1:x_length
        x[i] ~ Normal(i, 1.0)
    end
end

model = dynamic_model_for_ess()
mean(sample(Xoshiro(468), model, Gibbs(:b => PG(10), :x => ESS()), 2000))

Description

Results for b and x[1] are reproducible when sampling with the same seed, but x[2] is not.

Julia version info

Turing 0.39.7 / Julia 1.11.6

Manifest

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions