def generate_kindofgarch(nobs, ar, ma, mu=1.0):
 from statsmodels.tsa.arima_process import arma_generate_sample
 h = arma_generate_sample(ar, ma, nobs, 0.1)
 h = ((mu + h) ** 2)
 h = np.exp(h)
 err = (np.sqrt(h) * np.random.randn(nobs))
 return (err, h)

def generate_kindofgarch ( nobs , ar , ma , mu = 1.0 ) : from statsmodels . tsa . arima_process import arma_generate_sample h = arma_generate_sample ( ar , ma , nobs , 0.1 ) h = ( ( mu + h ) ** 2 ) h = np . exp ( h ) err = ( np . sqrt ( h ) * np . random . randn ( nobs ) ) return ( err , h )
simulate garch like process but not squared errors in arma used for initial trial but produces nice graph .