Say I have two variables a and b and I know the full 2x2 covariance between them. Is there a Julia package to conveniently propagate Gaussian uncertainy through arbitrary functions of them in the same way that Measurements.jl works for single variables? Like I want:
Not exactly what you are asking for, but the Reachability Analysis community has some tools for “imprecise probabilities” that may be of value. They are guaranteed to bound the probabilities, however in some cases the over approximation can be too conservative to be useful.
Another thought is that if the function is invertible, computing the push-forward density is simple
Even if the function is invertible, knowing it is another issue. I don’t know if a multi-variate version of Series Reversion exists (I think I’ve seen it before), but if so, adding that to TaylorSeries.jl would make a pretty general solution, albeit approximate.
You are right, MCM.jl is particle-based, the constructor is even called Particles
Since you are asking about AD-based solutions, I’ll note that you get exact propagation of multivariate normal distributions through linear functions using the unscented transform. These situations are also the only situations in which AD-based solutions are exact (the ones that use first-order approximations). The unscented transform selects a small number of samples carefully, in a way that allows for exact propagation of Gaussians. In any other case than linear and Gaussian, simple linearization for uncertainty propagation is fraught with a lot of pitfalls, while the unscented transform typically fails slightly less catastrophically.
You can perform the unscented transform using MCM.jl by constructing sigmapoints.