def corr_arma(k_vars, ar, ma):
 from scipy.linalg import toeplitz
 from statsmodels.tsa.arima_process import arma2ar
 ar = arma2ar(ar, ma, nobs=k_vars)[:k_vars]
 return toeplitz(ar)

def corr_arma ( k_vars , ar , ma ) : from scipy . linalg import toeplitz from statsmodels . tsa . arima_process import arma2ar ar = arma2ar ( ar , ma , nobs = k_vars ) [ : k_vars ] return toeplitz ( ar )
create arma correlation matrix converts arma to autoregressive lag-polynomial with k_var lags ar and arma might need to be switched for generating residual process parameters ar : array_like .