Turing.jl: rand() and broadcast question

Created on 14 Sep 2018  路  3Comments  路  Source: TuringLang/Turing.jl

Just checking, is this intended?
https://github.com/TuringLang/Turing.jl/blob/cba33402b3d71e95aa5cee9c043db5698b9f3b8c/src/samplers/support/resample.jl#L86
Using rand() like this will add the same random variable to all entries. To broadcast rand as well, we need rand.().

question

Most helpful comment

Sharing rand is the correct behaviour here - this resembling function is specifically designed for minismising Monte Carlo variance by reducing total amount of randomness.

Link to the matlab version:
https://uk.mathworks.com/matlabcentral/fileexchange/24968-resampling-methods-for-particle-filtering

All 3 comments

Sharing rand is the correct behaviour here - this resembling function is specifically designed for minismising Monte Carlo variance by reducing total amount of randomness.

Link to the matlab version:
https://uk.mathworks.com/matlabcentral/fileexchange/24968-resampling-methods-for-particle-filtering

This rand() thing is a common mistake so I was double checking. Thanks.

You raised a good point - there might be other places in Turing where we should broadcast rand.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcoct picture marcoct  路  6Comments

yebai picture yebai  路  6Comments

krishvishal picture krishvishal  路  6Comments

ClaudMor picture ClaudMor  路  4Comments

mohamed82008 picture mohamed82008  路  4Comments