{"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":"python","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,"search_vec":"'2.1.1':58 'analysi':51 'api':46 'arima':4,25,72 'auto':3,77 'auto-arima':2 'auto-ml':76 'auto.arima':17 'autom':19 'autoregress':26 'averag':29 'build':36 'compat':66 'complex':48 'current':55 'depend':68 'equival':13 'forecast':34,73 'function':18 'integr':27 'learn':44,75 'librari':9,53 'like':45 'machin':74 'ml':78 'model':30 'move':28 'offer':40 'optim':24 'pmdarima':1,5 'process':21 'provid':11 'python':8,64 'r':15 'receiv':60 'regular':61 'scikit':43 'scikit-learn-lik':42 'select':23 'seri':33,50,71 'simplifi':47 'statsmodel':38,79 'support':69 'time':32,49,70 'updat':62 'version':57,65","created_at":"2026-04-09T18:47:29.551952+00:00","updated_at":"2026-04-16T18:05:05.056279+00:00","problems":[{"fix":"Ensure `pmdarima` is installed in the correct environment using `pip install pmdarima` or `conda install -c conda-forge pmdarima`. If using an IDE or Jupyter, verify that the active kernel/interpreter matches the installation location.","cause":"The `pmdarima` library is not installed in the Python environment currently being used, or the Python interpreter running the code is different from the one where `pmdarima` was installed.","error":"ModuleNotFoundError: No module named 'pmdarima'"},{"cause":"`pmdarima` uses Cython and requires C/C++ compilers (build tools) to be present on the system for successful installation if a pre-built wheel is not available for your specific Python version and operating system. Outdated `pip`, `setuptools`, or `wheel` can also contribute to this.","error":"ERROR: Failed building wheel for pmdarima"},{"cause":"The `auto_arima` function often encounters difficulty converging or finding an optimal model if the input time series data is non-stationary (exhibits trends or seasonality that haven't been accounted for by differencing) or if the search space for ARIMA orders is too constrained or inappropriate for the data.","error":"ValueError: Could not successfully fit ARIMA to input data. It is likely your data is non-stationary. Please induce stationarity or try a different range of model order params."},{"cause":"This error typically arises due to an incompatibility between the installed version of `pmdarima` (or its underlying dependencies) and `NumPy`, usually when a `NumPy` version change (e.g., from 1.x to 2.x) breaks binary compatibility, requiring dependent packages to be recompiled or updated.","error":"ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.1.1","cli_name":"","cli_version":null,"type":"library","homepage":"http://alkaline-ml.com/pmdarima","github":"https://github.com/alkaline-ml/pmdarima","docs":"http://alkaline-ml.com/pmdarima","changelog":null,"pypi":"https://pypi.org/project/pmdarima/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}