library(tidyverse)
library(readxl)
library(alfred)

Exercise 3A: Survey of Professional forecasters

  1. U.S. Bureau of Economic Analysis
https://www.philadelphiafed.org/-/media/research-and-data/real-time-center/survey-of-professional-forecasters/spf-documentation.pdf?la=en
  1. Prior to 1992 the values are forecasts for nominal GNP, after 1992 nominal GDP. GNP is the total value of goods and services produced by nationals of the country in a certain period of time. GDP is the total value of goods and services produced in the country in a certain period of time.
  2. Seasonal fluctuations may not reflect economic conditions
  3. Flow variable.
  4. No. It also includes inflation.
  5. Deadline date: 2/9/05
https://www.philadelphiafed.org/-/media/research-and-data/real-time-center/survey-of-professional-forecasters/spf-release-dates.txt?la=en
spf <- read_excel("Individual_NGDP.xlsx",sheet=1)
spf2005Q1for <- spf %>% filter(YEAR==2005,QUARTER==1) %>% 
  mutate(forecast=as.double(NGDP2)) %>% 
  select(ID,forecast) %>% drop_na()  
  1. What is the mean forecast for the first quarter of 2005?
mean(spf2005Q1for$forecast)
## [1] 12145

10 Forecaster with ID 99

spf2005Q1for %>% arrange(desc(forecast))
## # A tibble: 35 x 2
##       ID forecast
##    <dbl>    <dbl>
##  1    99   12224 
##  2   508   12182.
##  3   510   12179.
##  4   527   12170.
##  5   528   12170.
##  6   426   12167.
##  7   456   12163.
##  8   463   12162.
##  9   512   12159 
## 10   431   12156.
## # ... with 25 more rows

Exercise 3B: Real-time data vintages

library(alfred)
fred2005Q1vin <- as_tibble(get_alfred_series("GDP", 
                                             observation_start = "2005-01-01",
                                             observation_end = "2005-01-01"))
  1. U.S. Bureau of Economic Analysis
https://alfred.stlouisfed.org/series?seid=GDP
  1. https://research.stlouisfed.org/fred_terms.html
  2. vintage 2005-04-28
fred2005Q1vin %>% ggplot(aes(y=GDP,x=realtime_period))+geom_line()

5. The comprehensive revisions in 2009 and 2013 incorporated changes in definitions, classifications, statistical methods, source data, and presentation. The other changes may be due to improved samples, data, and seasonal factors.