{r setup, include=FALSE} options(bitmapType=‘cairo’) options(digits = 3, scipen = 99999) remove(list = ls()) graphics.off()

suppressWarnings({ suppressPackageStartupMessages({ library(markovchain) library(tidyverse) library(quantmod) library(tsbox) library(vars) library(xts) library(TSstudio) }) })

Introduction

Understanding the state of the economy is crucial for policymakers, businesses, and individuals alike. In this analysis, we construct a diffusion index for the United States economy using three economic indicators: Unemployment Rate (UNRATE), Industrial Production Index (INDPRO), and Retail Sales (RSAFSNA). Diffusion indexes serve as a measure of economic activity, aggregating diverse signals into a single value that helps in identifying trends and turning points.

This analysis is a part of the coursework for *Pompea College of Business, University of New Haven. My name is **Sarangam Sathwik*, and I hope this analysis will provide valuable insights into the dynamics of the US economy.

Data Collection

The first step in constructing the diffusion index is to gather relevant data. We have selected three key indicators that provide a balanced representation of the economic condition:

  • Unemployment Rate (UNRATE): An indicator of labor market health, reflecting the percentage of unemployed individuals actively seeking jobs.
  • Industrial Production Index (INDPRO): A measure of the output of the industrial sector, indicating changes in production activity.
  • Retail Sales (RSAFSNA): Represents consumer spending, a crucial driver of economic growth.

The data for these indicators has been collected from FRED (Federal Reserve Economic Data).

{r data-collection} # Pick 3 pertinent economic variables for the US getSymbols(c(“UNRATE”, “INDPRO”, “RSAFSNA”), freq = “monthly”, src = “FRED”, return.class = ‘xts’, index.class = ‘Date’, from = “2010-01-01”, to = Sys.Date(), auto.assign = TRUE)

Convert data into a single time-series dataset

us_data <- merge(UNRATE, INDPRO, RSAFSNA) colnames(us_data) <- c(“Unemployment_Rate”, “Industrial_Production”, “Retail_Sales”)

Data Standardization

In order to make these indicators comparable, we need to standardize them. Standardization ensures that differences in scale between the variables do not bias the diffusion index.

{r data-standardization} # Standardize each series to ensure comparability us_data_scaled <- us_data %>% na.omit() %>% scale() %>% as.xts()

Constructing the Diffusion Index

The diffusion index is constructed by averaging the standardized versions of the three indicators. By aggregating these indicators, we can gain a broader picture of the general economic trends.

{r diffusion-index} # Constructing a diffusion index by averaging standardized variables us_data_diffusion <- rowMeans(us_data_scaled, na.rm = TRUE) us_data_diffusion <- xts(us_data_diffusion, order.by = index(us_data_scaled))

Plotting the Diffusion Index

The diffusion index provides a broad view of the economy by aggregating multiple indicators into a single measure. Below, we analyze the constructed diffusion index over time.

  • The diffusion index plot highlights key turning points in the economy. For instance, we observe a sharp decline during the COVID-19 pandemic period starting in early 2020. This is indicative of the severe economic shock due to lockdowns, job losses, and disruptions in industrial production.
  • The loess smoother (red line) helps to clearly identify underlying trends in the economy. The smoother reduces short-term fluctuations and provides an overall trend, showing periods of economic expansion and contraction.
  • We can see that after the sharp decline in 2020, there was a steady upward trend, indicating a recovery phase. This could be attributed to various stimulus measures, easing of restrictions, and gradual improvement in industrial activity and employment.
  • Notably, there are still periods of volatility post-recovery, suggesting that the economy has faced challenges, such as ongoing supply chain disruptions and inflationary pressures.

The following plot visualizes the diffusion index over time, with a loess smoother added to highlight the overall trend.

{r plot-diffusion-index, echo=FALSE, message=FALSE, warning=FALSE, dev=‘png’} us_data_df <- data.frame(Date = index(us_data_diffusion), Diffusion_Index = coredata(us_data_diffusion))

ggplot(us_data_df, aes(x = Date, y = Diffusion_Index)) + geom_line(color = “blue”) + geom_smooth(method = “loess”, color = “red”) + labs(title = “Diffusion Index of Selected US Economic Variables”, x = “Date”, y = “Diffusion Index”) + theme_minimal()

The diffusion index highlights key turning points in the economy. For instance, we observe sharp declines during significant economic downturns, such as the COVID-19 pandemic period in 2020.

Comparison with Chicago Fed National Activity Index (CFNAI)

The Chicago Fed National Activity Index (CFNAI) serves as a benchmark for national economic activity. By comparing our diffusion index to the CFNAI, we can assess how well our selected indicators track broader economic trends.

{r get-cfnai} # Comparing with Chicago Fed National Activity Index: Diffusion Index (CFNAI) getSymbols(“CFNAI”, src = “FRED”, return.class = ‘xts’, from = “2010-01-01”, to = Sys.Date(), auto.assign = TRUE)

Aligning both datasets to the same date range to avoid invalid time issues

common_start_date <- max(start(us_data_diffusion), start(CFNAI)) common_end_date <- min(end(us_data_diffusion), end(CFNAI)) us_data_diffusion_aligned <- window(us_data_diffusion, start = common_start_date, end = common_end_date) CFNAI_aligned <- window(CFNAI, start = common_start_date, end = common_end_date)

Merge both indexes for comparison

combined_data <- merge(us_data_diffusion_aligned, CFNAI_aligned, join = “inner”) colnames(combined_data) <- c(“Diffusion_Index”, “Chicago_Fed_Index”)

Correlation Analysis

The correlation between our diffusion index and the CFNAI gives us an indication of how closely the two indexes track each other.

{r correlation-analysis} # Calculating correlation correlation <- cor(combined_data\(Diffusion_Index, combined_data\)Chicago_Fed_Index, use = “complete.obs”) print(paste(“Correlation Coefficient:”, round(correlation, 3)))

The correlation coefficient is calculated above. A high correlation value would indicate that our selected indicators effectively mirror the general economic activity captured by the CFNAI.

Plotting Both Indexes for Comparison

The comparison between the diffusion index we created and the Chicago Fed National Activity Index (CFNAI) reveals important insights into how well our selected indicators reflect overall economic activity.

  • The Diffusion Index (blue line) and the CFNAI (green line) show a significant degree of similarity in their movement, particularly during periods of economic stress, such as the *COVID-19 downturn. This similarity is captured by the high **correlation coefficient*, indicating that our three chosen indicators—unemployment rate, industrial production, and retail sales—are effective in summarizing broader economic activity.
  • However, there are periods of divergence between the two indexes. For instance, in mid-2021, the CFNAI shows a slightly less steep increase compared to our diffusion index. This divergence could be due to the different weightage or composition of the components in CFNAI compared to our selected indicators. CFNAI considers a wider array of components, which might be capturing additional nuances in economic conditions that our diffusion index does not.
  • The period between late 2021 and 2022 shows smaller fluctuations in CFNAI compared to our diffusion index. This may imply that factors not included in our analysis, such as changes in service sector activity or variations in housing permits, may have played a significant role in stabilizing broader economic measures.
  • Overall, the similar trends in both indexes validate the effectiveness of our indicator selection, but the observed differences also emphasize the importance of expanding the selection to include more diverse components if we want to capture the entire spectrum of economic activity.

Below, we plot both indexes side by side to visualize their similarities or differences over time.

{r plot-comparison, echo=FALSE, message=FALSE, warning=FALSE, dev=‘png’} combined_data_df <- data.frame(Date = index(combined_data), Diffusion_Index = coredata(combined_data\(Diffusion_Index), Chicago_Fed_Index = coredata(combined_data\)Chicago_Fed_Index))

ggplot(combined_data_df) + geom_line(aes(x = Date, y = Diffusion_Index, color = “Diffusion Index”)) + geom_line(aes(x = Date, y = Chicago_Fed_Index, color = “Chicago Fed Index”)) + labs(title = “Comparison of Diffusion Indexes”, x = “Date”, y = “Index Value”) + theme_minimal() + scale_color_manual(values = c(“Diffusion Index” = “blue”, “Chicago Fed Index” = “green”))

In the comparison plot, periods where the two indexes move together indicate strong alignment in the economic trends they represent. Deviations between the indexes may suggest differences in how each index responds to specific economic shocks or events.

Insights and Conclusion

The analysis shows that our diffusion index closely tracks the CFNAI, as evidenced by the correlation coefficient and visual comparison. Given that the CFNAI data ends in September, we observe that our diffusion index continues to provide valuable insights into the ongoing economic conditions, which suggest a gradual recovery.

  • The high correlation between our diffusion index and the CFNAI suggests that the selected indicators—unemployment rate, industrial production, and retail sales—are effective in representing overall economic activity.
  • During the COVID-19 pandemic, both indexes show a rapid decline, followed by a gradual recovery, which illustrates the significant economic impact and subsequent recovery phase.
  • In periods of divergence between the two indexes, it is important to consider additional economic variables that might help in closing the gap. For example, sectors such as housing or financial activities, which are part of the CFNAI, could explain some of the differences observed.
  • Our diffusion index also reflects economic volatility post-pandemic, indicating that although the recovery has been underway, various challenges like inflation, supply chain issues, and policy changes have continued to affect the economic landscape.

This analysis serves as a foundation for understanding how diffusion indexes are constructed and used to monitor economic activity. The selected indicators—Unemployment Rate, Industrial Production, and Retail Sales—collectively provide a comprehensive picture of the economy, aligning well with broader measures like the CFNAI. However, expanding the range of indicators may further improve the robustness and accuracy of the index.

The analysis shows that our diffusion index closely tracks the CFNAI, as evidenced by the correlation coefficient and visual comparison. Given that the CFNAI data ends in September, we observe that our diffusion index continues to provide valuable insights into the ongoing economic conditions, which suggest a gradual recovery.

During periods of divergence, further analysis would be needed to understand which of the underlying indicators are driving the differences. This highlights the importance of selecting a diverse range of economic indicators to create a diffusion index.

This analysis serves as a foundation for understanding how diffusion indexes are constructed and used to monitor economic activity. The selected indicators—Unemployment Rate, Industrial Production, and Retail Sales—collectively provide a comprehensive picture of the economy, aligning well with broader measures like the CFNAI.

Acknowledgments

This report is part of the coursework for the Pompea College of Business, University of New Haven. I would like to thank my professors and colleagues for their guidance throughout this project.