Replies: 1 comment 1 reply
-
I think there's an issue with your function make_obs(ti_obs::Vector{Int}, delta_obs::Vector{Int})
obs = choicemap()
obs[:K] = length(ti_obs)
for (i, t) in enumerate(ti_obs)
obs[Symbol(:ti, i)] = t
end
for (i, d) in enumerate(delta_obs)
obs[Symbol(:delta, i)] = d
end
return obs
end But the function make_obs(ti_obs::Vector{Int}, delta_obs::Vector{Int})
obs = choicemap()
obs[:K] = length(ti_obs)
for (i, t) in enumerate(ti_obs)
obs[(:ti, i)] = t
end
for (i, d) in enumerate(delta_obs)
obs[(:delta, i)] = d
end
return obs
end Hopefully that's the only issue (i.e. you weren't conditioning on the right observations -- Gen doesn't always throw an error when you condition on addresses that don't exist in the model). Otherwise the model is a bit too complicated for me to debug without running it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I have a model implementated in Gen.jl, where Metropolis Hastings works well (giving a reasonable posterior), but where importance sampling does very poorly in terms of the posterior distribution. In a not-too-different model (here), IS and MH have fairly similar posterior distributions. Can anyone see why importance (re)sampling isn't working here?
The issue doesn't seem to be a lack of proposal. I also thought it may be due to not keeping a copy of the trace; however, the below code also doesn't give good performance:
Beta Was this translation helpful? Give feedback.
All reactions