Resample in place to avoid expensive copying of data structures, using a permutation of the ancestry vector.
resampleParticles(log_weights, ampMx, scaleMx, peaks, baselines, n_y, nwl)
logarithms of the importance weights of each particle
npeaks x npart
Matrix of amplitudes for each particle.
npeaks x npart
Matrix of scale parameters for each particle.
nwl x npart
Matrix containing the expectation of the Lorentzian mixture.
nwl x n_y x npart
Array of smoothing splines.
number of observations
number of wavenumbers
Vector of indices to the parents of the resampled particles.
Murray, L.M., Lee, A. & Jacob, P.E. (2015) "Parallel resampling in the particle filter" arXiv:1301.4019v3