Open draktr opened 1 year ago
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.
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.
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 attributeW
are the weights that are applied to importance-sampled particles to getX
, 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 withnext()
methods forparticles.SMC
class objects, but that seems to be the regular update step similar to the one in SIR algorithm.