Illustration of generic particle filter with importance sampling and resampling. In a generic operation, i.i.d. samples or particles (with equal weights) are first drawn from a proposal distribution. Ticks illustrate the neural spike observations overlaid on the conditional distribution p(y|z). Next, the particles are passed through the likelihood function p(yk|zk), weighted by their importance weights. More important particles are assigned greater weights (proportional to the size of the circles). The particles are further resampled to avoid the “weight degeneracy” problem, so that the importance weights are renormalized. Finally, the resampled particles are used for prediction in the next time step, producing the new particle set .