multinomial_conditional_resample

function multinomial_conditional_resample(w:Real[_], b:Integer) -> (Integer[_], Integer[_], Integer)

Sample a conditional ancestry vector for a log-weight vector using multinomial resampling.

  • w: Log-weight vector.
  • b: Index of the conditioned particle.

Returns: a tuple giving the ancestor vector, offspring vector, and new index of the conditioned particle.