hpa.fun.toy(x) Internal function pdm.maker() shows how the B matrix is
obtained from the various elements of input argument x. Note
how, in this simple example, the B matrices are diagonal, but
generalizing to non-diagonal matrices should be straightforward (if
you can guarantee that they remain positive definite).