See the returns.ipynb
notebook in this folder.
I use miniconda through Homebrew on my Mac to setup the required environment:
conda create -n returns -c conda-forge matplotlib==3.8.3 notebook==7.1.0 pyarrow==15.0.0 statsmodels==0.14.1 python=3.10.13
conda activate returns
jupyter notebook returns.ipynb
Finally the created environment above can be removed through:
conda deactivate && conda remove --name returns --all