Skip to content

Instantly share code, notes, and snippets.

@kperry2215
Created January 4, 2020 23:33
Show Gist options
  • Save kperry2215/c6f181b6862adedd6971fa6d3127dd54 to your computer and use it in GitHub Desktop.
Save kperry2215/c6f181b6862adedd6971fa6d3127dd54 to your computer and use it in GitHub Desktop.
def sarima_parameter_search(search_range, seasonal = [12]):
"""
Get all of the parameter combinations for a SARIMA model.
"""
p = q = d = range(0, search_range)
trend = ['n','c','t','ct']
pdq = list(itertools.product(p, d, q))
pdq_combinations = [(x[0], x[1], x[2], x[3], x[4]) for x in list(itertools.product(p, d, q, seasonal, trend))]
return pdq, seasonal_pdq_combinations
### EXECUTE IN MAIN FUNCTION ###
order_combos, seasonal_order_combos = sarima_parameter_search(search_range = 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment