Can a normal citizen make sense of Economics?
Here's a few links that inspired me to explore this:
- Paul Krugman “Economics and Politics by Paul Krugman - The Conscience of a Liberal” (Profile at The New York Times)
- Wikipedia “Economy of the United States”
- The Federal Reserve Bank of St. Louis “Federal Reserve Economic Data (FRED)”
- The Federal Reserve Bank of Philadelphia “Survey of Professional Forecasters”
- Quandl
If I wanted to understand what was happening and get around all the garbage that is being spewed at me by politicians and the so called media, then it seems that I need to start learning to do the analysis for myself.
Can one do the analysis for themselves?
Perhaps something along the lines of using autoregressive integrated moving average (ARIMA) models with the R Project for Statistical Computing software:
Dataset Information:
- Frequency quarterly
- Source Federal Reserve Economic Data
- Raw Data: http://research.stlouisfed.org/fred2/data/GDP.txt
- Quandl Code: “FRED/GDP”
- Description
- Units: Billions of Dollars
- Seasonal Adjustment: Seasonally Adjusted
- Annual Rate Notes: A Guide to the National Income and Product Accounts of the United States (NIPA)
y <- Quandl("FRED/GDP", type = "xts")
layout(matrix(c(1, 1, 2, 3), 2, 2, byrow = TRUE))
plot.ts(y, main = "FRED/GDP", ylab = "FRED/GDP")
acf(y, main = "Autocorrelations", ylim = c(-1, 1))
pacf(y, main = "Partial Autocorrelations", ylim = c(-1, 1))
The autocorrelations trail off slowly, so we'll need to difference at least once. The single spike at lag one in the partial autocorrelations indicates an AR(n)-process.
library(forecast)
## This is forecast 4.05
fcst <- forecast(auto.arima(y), h = 20)
## Warning: p-value smaller than printed p-value
## Warning: p-value smaller than printed p-value
## Warning: p-value greater than printed p-value
plot(fcst, main = "FRED/GDP")
Of course this is garbage, because I haven't actually figured out what I'm doing yet, run any diagnostics, validated anything, nor extracted any results.
Besides the substance, I need to clean it up, put dates on the plots and setup to track my forecasts and compare them to published forecasts.
Gary Young
No comments:
Post a Comment