This is somewhat an abstract question. In Mathematica there is a function TimeSeriesModelFit which automatically finds the best autoregressive model fitting the data. Is there a way to do the same in Python? Might it be there is a package for this?
This is the data from Mathematica itself as an example:
data = {5., 9., 8., 10., 6.1, 10.4, 9.1, 11.6, 7.5, 12.1, 10.4, 13.5,
9., 14.1, 11.9, 15.7, 10.8, 16.4, 13.7, 18.3, 12.9, 19., 15.8, 21.2,
15.3, 22.1, 18.3, 24.6};