Sorts outputs of particle filter based on index - returns a sorted list of particles, based on the sampling trajectory through time. This is a somewhat more accurate estiamte of the true posterior than are the stepwise samples provided by the filter.
indexsort(fulltracemat, fulltraceindex, nsmp = NULL)an index-sorted matrix - each column shows the trajectory of a single particle
full output of particles from the particleFilterLL function
full output of particle indices from the particleFilterLL function
number of particle paths to sample - defaults to NULL, which samples all paths