'The coefficient matrix for the state vector in the observation equation.
Its dimension is r+k x 1.
Parameters
r : int
In the context of the ARMA model r is max(p,q+1) where p is the
AR order and q is the MA order.
k : int
The number of exogenous variables in the ARMA model, including
the constant if appropriate.
q : int
The MA order in an ARMA model.
p : int
The AR order in an ARMA model.
References
Durbin and Koopman Section 3.7.'

@classmethod
def R(cls, params, r, k, q, p):

    arr = zeros((r, 1), dtype=params.dtype, order='F')
    arr[1:(q + 1), :] = params[(p + k):((p + k) + q)][:, None]
    arr[0] = 1.0
    return arr
