Python SciPy - obtain minimum AIC for SARIMAX -
i trying obtain p , q parameters aic quotient of seasonal arima function minimum, using scipy brute. p & q taking values in range 0-2 , simplicity, fixed d , d below.
the code is:
def objfunc(grid): p, q = grid mod = sm.tsa.statespace.sarimax(timeseries,order=(p,0,q), seasonal_order=(p,1,q,12), enforce_stationarity=false, enforce_invertibility=false) results = mod.fit() return results.aic; grid = (slice(1, 3, 1),slice(1, 3, 1)) solution = brute(objfunc, grid, finish=none,full_output = true)
i error:
typeerror: object of type 'numpy.int32' has no len(). sarimax function generates errors p&q values not sure how fix it. please help.
Comments
Post a Comment