add more tests of matrix algebra for computing expectations