Recently Published
Plot
Plots from regression model, GDP, CPI, and UNRATE
Document
Statistical learning models are becoming a popular tool used to forecast and analyze Gross Domestic Product (GDP). They use macroeconomic indicators and time series data to improve prediction accuracy. This project will use a linear model to produce results that predict GDP over a 10-year period and compare it with actual results. If successful, it may be helpful for weathering unexpected shocks in the economy.
GDP growth rate is perhaps the best indicators of economic growth for a country. It is important to test theories and hypotheses using past data to hopefully get an idea of future trends. Accurate predictions of GDP growth will allow economists and politicians to make better adjustments to monetary and fiscal policy. The biggest challenge/problem is developing accurate models. This project is intended to assist with the many tools already used for determining GDP trends. This project starts with a linear model (LM) and is constructed using the GDP as a response variable. The CPI and Unemployment rate will be used as predictors. Cross-Validation will be used to estimate the accuracy of the test error (model assessment). It will not be an exhausted model for capturing all possibilities within the economic framework, but a functioning statistical learning code with the capacity for adding additional relevant models in the future.
The linear regression model showed that unemployment rate is inversely proportionate to GDP (as unemployment goes up, GDP goes down). This was expected; it follows Okun's law. However, the scatter plot revealed a clear nonlinear pattern between them. Therefore, a nonlinear regression method was used, the polynomial regression. A 4-degree polynomial was initial used in the model as a starting point. However, the cross-validation test showed that the best polynomial regression model is with a 2-degree polynomial.
The coefficient of determination R^2 method was use to predict the country's Gross Domestic Product (GDP) on the basis of statistical variables associated with its performance, i.e., the unemployment rate (UNRATE), consumer price index (CPI) and certain dates that recorded unexpected shocks in the economy (observation date). The regsubsets function was used to help select variables for the best model. The model with the lowest Bayesian Information Criteria (BIC) is the two variable model that contains CPI and UNRATE.
The variables that had the most impact on GDP were CPI and UNRATE. UNRATE and CPI had the least errors in the test, -213.75, 139.27 respectively, indicating they have the most impact on GDP. Of the three variables, observation date had the least impact. This is consistent with real world experiences. For example, during a major economic shock, like in 2020 with Covid and mandatory government shut-downs, the data is radically inconsistent. Aside from rare unforeseen events that result in major economic shocks, seen in the observation date variable, GDP and UNRATE are the indicators most likely to impact GDP.