{"id":2193,"library":"pmdarima","title":"pmdarima (Auto-ARIMA)","description":"pmdarima is a Python library that provides an equivalent to R's `auto.arima` function, automating the process of selecting optimal ARIMA (AutoRegressive Integrated Moving Average) models for time series forecasting. It builds on `statsmodels` but offers a scikit-learn-like API, simplifying complex time series analysis. The library is currently at version 2.1.1 and receives regular updates for Python version compatibility and dependency support.","status":"active","version":"2.1.1","language":"en","source_language":"en","source_url":"https://github.com/alkaline-ml/pmdarima","tags":["time series","ARIMA","forecasting","machine learning","auto-ml","statsmodels"],"install":[{"cmd":"pip install pmdarima","lang":"bash","label":"Install pmdarima"}],"dependencies":[{"reason":"Required runtime environment","package":"python","version":">=3.10","optional":false},{"reason":"Core numerical operations; v2.1.0 dropped support for Numpy 1.x","package":"numpy","version":">=2.0.0","optional":false},{"reason":"Scientific computing; minimum version increased in v2.1.0","package":"scipy","version":">=1.13.0","optional":false},{"reason":"Underlying statistical models; minimum version increased in v2.1.0","package":"statsmodels","version":">=0.14.5","optional":false},{"reason":"Data structures and analysis","package":"pandas","version":">=0.19","optional":false},{"reason":"Scikit-learn compatible API and utilities","package":"scikit-learn","version":">=0.22","optional":false},{"reason":"Parallelization for `n_jobs`","package":"joblib","version":">=0.11","optional":false},{"reason":"Used for performance-critical sections and building from source","package":"Cython","version":">=0.29,!=0.29.18,!=0.29.31","optional":false}],"imports":[{"symbol":"auto_arima","correct":"from pmdarima import auto_arima"},{"note":"ARIMA is located in the `pmdarima.arima` submodule, not directly under `pmdarima`.","wrong":"from pmdarima import ARIMA","symbol":"ARIMA","correct":"from pmdarima.arima import ARIMA"}],"quickstart":{"code":"import pmdarima as pm\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Generate some sample time series data\ny = np.random.rand(100) * 10 + np.arange(100) # Simple trend + noise\n\n# Fit a stepwise auto_arima model\nmodel = pm.auto_arima(y, \n                      start_p=1, start_q=1,\n                      test='adf',       # use adftest to find optimal 'd'\n                      max_p=3, max_q=3, # maximum p and q\n                      m=1,              # frequency of series\n                      d=None,           # let model determine 'd'\n                      seasonal=False,   # No seasonality\n                      start_P=0, \n                      D=0,\n                      trace=False,      # Suppress verbose output\n                      error_action='ignore',  \n                      suppress_warnings=True, \n                      stepwise=True)\n\n# Make predictions\nforecast, conf_int = model.predict(n_periods=10, return_conf_int=True)\n\nprint(\"Forecast:\", forecast)\nprint(\"Confidence Interval:\", conf_int)\n\n# Optional: plot results\n# plt.plot(y, label='Actual')\n# plt.plot(np.arange(len(y), len(y) + len(forecast)), forecast, label='Forecast')\n# plt.fill_between(np.arange(len(y), len(y) + len(forecast)),\n#                  conf_int[:, 0], conf_int[:, 1], alpha=0.1)\n# plt.legend()\n# plt.show()","lang":"python","description":"This quickstart demonstrates how to use `pmdarima.auto_arima` to automatically select and fit an ARIMA model to a time series and generate future predictions. The example uses a simple synthetic dataset, fits the model, and then forecasts 10 future periods. Parameters like `start_p`, `start_q`, `max_p`, `max_q`, and `seasonal` control the search space for the optimal ARIMA model."},"warnings":[{"fix":"Upgrade Python to 3.10 or newer. As of v2.1.1, Python 3.10, 3.11, 3.12, 3.13, and 3.14 are supported.","message":"Version 2.1.0 removed support for Python 3.7, 3.8, and 3.9. Projects using these older Python versions must either remain on pmdarima < 2.1.0 or upgrade their Python environment.","severity":"breaking","affected_versions":">=2.1.0"},{"fix":"Ensure Numpy is upgraded to version 2.0.0 or newer.","message":"Version 2.1.0 introduced support for Numpy 2.x and simultaneously removed support for Numpy 1.x. Older projects might encounter build or runtime errors if Numpy is not updated.","severity":"breaking","affected_versions":">=2.1.0"},{"fix":"Update SciPy to 1.13.0 or higher and Statsmodels to 0.14.5 or higher.","message":"Version 2.1.0 increased the minimum required versions for SciPy to >=1.13.0 and Statsmodels to >=0.14.5. Using older versions of these dependencies will likely result in installation issues or runtime errors.","severity":"breaking","affected_versions":">=2.1.0"},{"fix":"Carefully determine the seasonal period (`m`) based on the data's characteristics (e.g., 12 for monthly data, 4 for quarterly data, 7 for daily data with weekly seasonality). Seasonal decomposition (`pmdarima.arima.model.tsdisplay`) or domain knowledge can help.","message":"The `m` parameter (seasonal period) in `auto_arima` is not automatically detected and must be specified by the user. An incorrect `m` value can lead to suboptimal or erroneous seasonal models.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Replace `exogenous` with the `X` parameter and `sarimax_kwargs` with direct keyword arguments passed to the underlying `SARIMAX` model via `**kwargs`.","message":"The `exogenous` and `sarimax_kwargs` arguments to `ARIMA` and `auto_arima` were deprecated in earlier 1.x versions and will now raise a `TypeError` if used in 2.0.0 and later.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}