I am using Python's PyKalman to run the Kalman filter based on the ARMA(p,q) model. The transition matrix should take a very particular form (see, for instance, page 374 of Hamilton's "Times Series Analysis" for the AR(p) example) with some ones and zeros in the right places. When I use PyKalman's EM algorithm, however, it produces a transition matrix of a completely general form. Since the ones and the zeros are gone, the state-space model doesn't correspond anymore to the ARMA setting.
How can I use the EM method of the PyKalman package, while keeping the transition matrix in the very particular ARMA form?