Turing.jl icon indicating copy to clipboard operation
Turing.jl copied to clipboard

[Traces]: add a member field to `Trace` to mark reference particle

Open yebai opened this issue 7 years ago • 2 comments

The current resample! function requires an additional parameter to distinguish between normal particles and reference particle in conditional SMC. Perhaps a cleaner solution is to add a member field (e.g. is_ref) to the Trace type?

yebai avatar Nov 29 '17 20:11 yebai

That's seems like a good idea indeed.

emilemathieu avatar Dec 05 '17 16:12 emilemathieu

Isn't the reference particle always the last particle in the container, i.e., pc.vals[end] in a container pc? So I'm thinking maybe it would be more natural to have two implementations resample! and resample_with_reference! (or use only resample! and dispatch on a method type) instead of adding a field to every trace. In that way, i.e., without an additional field is_ref, it is also easier to guarantee that there exists only one reference particle in a container.

devmotion avatar Nov 21 '19 13:11 devmotion