'Wold representation moving average or VAR coefficients for the
steady state Kalman filter.
Parameters
j : int
The lag length
coeff_type : string, either \'ma\' or \'var\' (default=\'ma\')
The type of coefficent sequence to compute.  Either \'ma\' for
moving average or \'var\' for VAR.'

def stationary_coefficients(self, j, coeff_type='ma'):

    (A, G) = (self.ss.A, self.ss.G)
    K_infinity = self.K_infinity
    if (K_infinity is None):
        (S, K_infinity) = self.stationary_values()
    coeffs = []
    i = 1
    if (coeff_type == 'ma'):
        coeffs.append(np.identity(self.ss.k))
        P_mat = A
        P = np.identity(self.ss.n)
    elif (coeff_type == 'var'):
        coeffs.append(dot(G, K_infinity))
        P_mat = (A - dot(K_infinity, G))
        P = np.copy(P_mat)
    else:
        raise ValueError('Unknown    coefficient    type')
    while (i <= j):
        coeffs.append(dot(dot(G, P), K_infinity))
        P = dot(P, P_mat)
        i += 1
    return coeffs
