# How do Particle Filters give estimates of uncertainty?

In the Kalman Filter the final covariance matrix is the estimate of the filter's uncertainty. How does one do so in Particle filters? Is it just the variance among the particles for each state?

If so, then how do you deal with crosscorrelation?

For a simple case, given a particle set, calculate the weighted sum of the particles by iterating over each particle $$i$$ in the set $$N$$: $$\mu_{x} = \Sigma_{I=1}^{N} w_{i} x_{i}$$ And then calculate the weighted covariance for each particle $$i$$ in the set $$N$$ and sum them up: $$P_{xx} = \Sigma_{I=1}^{N} w_{i} (x_{i}-\mu_{x})(x_{i}-\mu_{x})^{T}$$ Where $$w_{i}$$ is the weight of the i(th) particle and $$x_{i}$$ is the state vector (column vector in this case) represented by that particle.