R/coupledresampling-indexmatching.R

#'@rdname CR_indexmatching
#'@title Coupled Resampling: index-matching
#'@description This function performs coupled resampling based on index-matching.
#'@return Two vectors of ancestors, column-binded in a matrix.
#'@export
CR_indexmatching <- function(xparticles1, xparticles2, normweights1, normweights2, ...){
  nparticles <- length(normweights1)
  uniforms <- runif(nparticles + 2)
  return(indexmatching_cpp(nparticles, normweights1, normweights2, uniforms) + 1)
}
pierrejacob/CoupledPF documentation built on May 25, 2019, 6:07 a.m.