I am running the following model for Bayesian updating:
using Turing, Distributions using StatsPlots (Script is reading the data here) @model function BayesLinearRegression(x, y) intercept ~ filldist(Normal(0, 1), n_sites) slope ~ filldist(Normal(0, 1), n_sites) sigma = zeros(n_sites) sigma ~ filldist(Beta(1, 5), n_sites) y_hat = intercept[idx] .+ slope[idx] .* x y ~ MvNormal(y_hat, sigma[idx]) end model = BayesLinearRegression(x, y) chain = sample(model, NUTS(0.65), 3_000)
Then, I am visualizing the trace with:
However, in the traceplot I only get one trace for each of the variables, while I should be getting n_sites traces for each.
Could you please explain how to fix the trace visualization?