{ "cells": [ { "cell_type": "markdown", "id": "642ede8c", "metadata": {}, "source": [ "# FOMC Topic Modeling\n", "\n", "_Our discussions of the economy may sometimes ring in the ears of the public with more certainty than is appropriate_ - Jerome Powell \n", "\n", "The Federal Open Market Committee (FOMC) meeting minutes may reveal the Federal Reserve's economic outlook, policy decisions, and potential future actions. Analyzing these minutes can help identify key topics discussed over time, shedding light on trends in monetary policy and their implications for financial markets. We review methods for accessing and pre-processing textual data, including the use MongoDB for storing and retrieving unstructured data. Several topic modeling algorithms, including Latent Semantic Analysis (LSA), Latent Dirichlet Allocation (LDA), Non-negative Matrix Factorization (NMF), and Probabilistic Latent Semantic Indexing (PLSI), are applied to uncover patterns within the minutes.\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "942f8042", "metadata": {}, "outputs": [], "source": [ "# By: Terence Lim, 2020-2025 (terence-lim.github.io)\n", "import numpy as np\n", "import pandas as pd\n", "from pandas import Series, DataFrame\n", "import os\n", "import sklearn.feature_extraction, sklearn.decomposition\n", "from sklearn.decomposition import TruncatedSVD, LatentDirichletAllocation, NMF\n", "from sklearn.cluster import KMeans\n", "from scipy.special import softmax\n", "from wordcloud import WordCloud\n", "import wordcloud\n", "import matplotlib.pyplot as plt\n", "from finds.database import MongoDB\n", "from finds.unstructured import Unstructured\n", "from finds.utils import Store\n", "from finds.readers import FOMCReader, Alfred\n", "from pprint import pprint\n", "from secret import credentials, paths\n", "# %matplotlib qt\n", "VERBOSE = 0" ] }, { "cell_type": "code", "execution_count": 3, "id": "9914ddee", "metadata": {}, "outputs": [], "source": [ "## retrieve recessions dates for plotting\n", "alf = Alfred(api_key=credentials['fred']['api_key'])\n", "vspans = alf.date_spans(series_id='USREC')" ] }, { "cell_type": "markdown", "id": "e6d9d80b", "metadata": {}, "source": [ "## FOMC meeting minutes\n", "\n", "The FOMC holds eight scheduled meetings per year, with additional meetings as necessary. The minutes from these meetings are released three weeks after the policy decision, offering crucial insights into the Federal Reserve's economic stance and possible future monetary policy actions. These insights can influence interest rates, inflation expectations, and overall market conditions.\n", "\n", "For official meeting schedules and minutes, visit: [Federal Reserve FOMC Calendar](https://www.federalreserve.gov/monetarypolicy/fomccalendars.htm).\n", "\n", "### FinDS `fomcreader` module\n", "\n", "The `fomcreader` module in the FinDS packages offers functions for searching and retrieving meeting minutes from the Federal Reserve website.\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "40267c5d", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 27/27 [00:16<00:00, 1.66it/s]\n" ] }, { "data": { "text/html": [ "
\n", " | dates | \n", "start | \n", "end | \n", "
---|---|---|---|
FOMC minutes | \n", "256 | \n", "19930203 | \n", "20250129 | \n", "
\n", " | minutes | \n", "
---|---|
19930203 | \n", "The Manager of the System Open Market Account ... | \n", "
19930323 | \n", "The Deputy Manager for Domestic Operations rep... | \n", "
19930518 | \n", "The Manager of the System Open Market Account ... | \n", "
19930707 | \n", "The Deputy Manager for Domestic Operations rep... | \n", "
19930817 | \n", "The Deputy Manager for Domestic Operations rep... | \n", "
... | \n", "... | \n", "
20240731 | \n", "Developments in Financial Markets and Open Mar... | \n", "
20240918 | \n", "Developments in Financial Markets and Open Mar... | \n", "
20241107 | \n", "Developments in Financial Markets and Open Mar... | \n", "
20241218 | \n", "Developments in Financial Markets and Open Mar... | \n", "
20250129 | \n", "Developments in Financial Markets and Open Mar... | \n", "
256 rows × 1 columns
\n", "