Teaching notebooks prepared as part of a computational finance course for undergraduate and graduate students. The material walks through three families of time series models, from univariate forecasting to volatility modeling and multivariate macro forecasting.
| Notebook | Topic | Learning objectives |
|---|---|---|
Time_series_analysis_1.ipynb |
Univariate ARIMA models | Decomposition, stationarity and the ADF test, differencing and log transforms, ACF/PACF correlograms, ARMA/ARIMA/SARIMAX, order selection with AIC/BIC and rolling out-of-sample RMSE |
Time_series_analysis_2.ipynb |
ARCH/GARCH volatility forecasting | Heteroskedasticity, volatility clustering, order selection via rolling out-of-sample forecasts, fitting a GARCH model and diagnosing residuals |
Time_series_analysis_3.ipynb |
VAR / VARMAX macro forecasting | Unit root testing across multiple series, VAR(p) and VARMAX estimation, residual diagnostics, impulse response analysis |
All data is pulled from the FRED database via
pandas-datareader. The series used are:
IPGMFN– Industrial production, manufacturingNASDAQCOM– NASDAQ Composite indexUMCSENT– University of Michigan consumer sentiment
The shared load_fred helper in utils.py caches each pull to data/*.csv on
first run, so the notebooks reproduce the same results offline afterwards.
Using pip:
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
pip install -r requirements.txtOr using conda:
conda env create -f environment.yml
conda activate time-series-modelsThe arch package (used in notebook 2) is included in both files, so no
separate install step is required.
jupyter notebookThen open any of the three notebooks and run the cells top to bottom. The first
run fetches data from FRED (network required); later runs use the cached CSVs in
data/.
- A global random seed is set in
utils.py(SEED = 42). - Data is cached to CSV so results do not change between runs.
- Notebook outputs are stripped from version control. Install the git filter
once with
nbstripout --installso committed notebooks stay clean.
Released under the MIT License.