def arma_generate_sample(ar, ma, nsample, sigma=1, distrvs=np.random.randn, burnin=0):
 eta = (sigma * distrvs((nsample + burnin)))
 return signal.lfilter(ma, ar, eta)[burnin:]

def arma_generate_sample ( ar , ma , nsample , sigma = 1 , distrvs = np . random . randn , burnin = 0 ) : eta = ( sigma * distrvs ( ( nsample + burnin ) ) ) return signal . lfilter ( ma , ar , eta ) [ burnin : ]
generate a random sample of an arma process parameters ar : array_like .