def index2lpol(coeffs, index):
 n = max(index)
 ar = np.zeros(n)
 ar[index] = coeffs
 return ar

def index2lpol ( coeffs , index ) : n = max ( index ) ar = np . zeros ( n ) ar [ index ] = coeffs return ar
expand coefficients to lag poly parameters coeffs : array non-zero coefficients of lag polynomial index : array index of lagpolynomial with non-zero elements ar : array_like coefficients of lag polynomial returns ar : array_like coefficients of lag polynomial .