aesara-devs / aeppl

Tools for an Aesara-based PPL.
https://aeppl.readthedocs.io
MIT License
64 stars 21 forks source link

Add relations to simplify convolutions of normally-distributed `RandomVariable`s #238

Open rlouf opened 1 year ago

rlouf commented 1 year ago

We should add rewrites that we can use to simplify the following expressions for Z_rv, B_rv and C_rv when conditioning:

import aesara.tensor as at

srng = at.random.RandomStream(0)
x_rv = srng.normal(0, 1)
y_rv = srng.normal(0, 2)
Z_rv = x_rv + y_rv # Normal RV

a_rv = srng.normal(0, 1, size=(10,))

B_rv = at.sum(a_rv) # Normal RV
C_rv = at.cumsum(a_rv) # Vector of normal RVs
larryshamalama commented 1 year ago

I can give this a shot. Perhaps I can start with working with Z_rv and see how the logic generalizes to B_rv and C_rv?

brandonwillard commented 1 year ago

I can give this a shot. Perhaps I can start with working with Z_rv and see how the logic generalizes to B_rv and C_rv?

That would be great, thanks!