'Returns the system matrices and other info needed for the
Kalman Filter recursions'

@classmethod
def _init_kalman_state(cls, params, arma_model):

    paramsdtype = params.dtype
    y = arma_model.endog.copy().astype(paramsdtype)
    k = (arma_model.k_exog + arma_model.k_trend)
    nobs = arma_model.nobs
    k_ar = arma_model.k_ar
    k_ma = arma_model.k_ma
    k_lags = arma_model.k_lags
    if arma_model.transparams:
        newparams = arma_model._transparams(params)
    else:
        newparams = params
    if (k > 0):
        y -= dot(arma_model.exog, newparams[:k])
    Z_mat = cls.Z(k_lags)
    m = Z_mat.shape[1]
    R_mat = cls.R(newparams, k_lags, k, k_ma, k_ar)
    T_mat = cls.T(newparams, k_lags, k, k_ar)
    return (y, k, nobs, k_ar, k_ma, k_lags, newparams, Z_mat, m, R_mat, T_mat, paramsdtype)
