Closed
Description
Calling sample
from the Chains
object returns an error "BoundsError: attempt to access 1000×2×1 Array{Float64,3} at index [[954, 537, 1308, 673, 876, 1081, 1182, 1271, 1141, 1315], 1:2, 1:1]"
How to reproduce:
@model function model_height(height)
μ ~ Normal(178, 20)
σ ~ Uniform(0, 50)
height ~ Normal(μ, σ)
end
chain = sample(model_height(178), NUTS(), 1000)
sample(chain, 10)
I guess this happens due to usage of range(chain)
, which includes the offset to the adaptation steps. If I create sampler as NUTS(0, 0.65)
, everything works.
Another solution I found is to sample from the result of resetrange(chain)
, which is better than avoiding adaptation steps. But still, it would be better to fix the problem.
Metadata
Metadata
Assignees
Labels
No labels