nchopin / particles

Sequential Monte Carlo in python
MIT License
390 stars 73 forks source link

Information request regarding particle attribute and predictive steps #60

Open draktr opened 1 year ago

draktr commented 1 year ago

1) What is not clear in the documentation is whether the X attribute of that object is weighted or unweighted particles. If those are weighted, then I assume that the array in attribute W are the weights that are applied to importance-sampled particles to get X, correct? 2) Is it possible to perform a predictive step for particle filtering with any of the algorithms in the library for sequential problems? I have tried it with next() methods for particles.SMC class objects, but that seems to be the regular update step similar to the one in SIR algorithm.

nchopin commented 1 year ago
  1. Attribute X is typically a numpy array of shape N or (N, d), which contains your N particles; these particles N particles are associated with N weights, which are stored in numpy array W (these weights are normalised to sum to one). At time t, you may compute the average np.average(phi(smc.X), weights=smc.W)
    to approximate the expectation of phi(X), relative to the current target distribution. Hope that answers your question.

  2. Depends what type of prediction you are looking for. A point estimate? The distribution of $Y_t$ given $Y1,\ldots, Y{t-1}$? (the $Y_t$ being the observed variables)? Samples from that distribution? There is nothing yet doing any of these things, but the 3rd one would be easy to implement, I can look into it.