Let’s say I have a simple Turing model
@model function model()
C ~ LKJ(3, 1.0)
x ~ MvNormal(zeros(3), C)
end
and obtained some posterior samples via MCMC
chain = sample(model(), NUTS(), 100)
or variational inference
q = vi(model(), ADVI(10, 1_000))
samples = rand(q, 100)
Is there an (easy) way to transform such samples into a vector of named tuples, i.e., [(C = Matrix, x = Vector), (C = Matrix, x = Vector), ...]
corresponding to the sampled random variables of the Turing model?
Could not find it in the documentation (hope to have just missed it).