Skip to content

Instantly share code, notes, and snippets.

@fccoelho

fccoelho/gasx.py Secret

Created April 8, 2017 19:47
Show Gist options
  • Save fccoelho/2199703c22361ebabdcb27e61eeb9008 to your computer and use it in GitHub Desktop.
Save fccoelho/2199703c22361ebabdcb27e61eeb9008 to your computer and use it in GitHub Desktop.
GASX model example that does not fit
import pandas as pd
import pyflux as pf
def build_model(data, ar=4, sc=4, family=pf.families.Poisson, formula=None):
if formula is None:
formula = "casos~1"
model = pf.GASX(data=data, ar=ar, sc=sc, family=family(), formula=formula)
return model
Full = pd.read_csv('data.csv.gz')
model = build_model(Full, ar=4, sc=6, formula='casos~1+temp_min+casos_est+p_inc100k+numero+umid_min+pressao_min+numero')
fit = model.fit()# 'BBVI', iterations=1000, optimizer='RMSProp')
print(fit.summary())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment