Python library for random variables with a matrix representation