Friday, 28 November 2025

statsmodels in Python

statsmodels is a Python package that complements scipy for statistical computation. 

The stable version is found here.

statsmodels takes ideas from other libraries and ecosystems, specifically it uses R-style formulas, and pandas DataFrames.  

Chances are you are using the library with other libraries too, like numpy.

It can be installed via Conda or pip. Examples:

conda install -c conda-forge statsmodel
python -m pip install statsmodels

Among the tricks statsmodels can perform are: time series analysis, various flavours of regression (OLS, generalized and weighted least squares), as well as PCA.

No comments: