Purpose:

A quick project: Put together the smallest framework needed for nowcasting. Not going for high accuracy here.

Findings:

A framework for nowcasting. Gives me confidence nowcasting is do-able for macro-economic series.

Meaning:

With more attention to data curation and selecting a series to nowcast, we can up sample a low frequency series to a higher frequency.

Results first, because I just want to see the stuff upfront as well

Blue dot is actual, green series is nowcast.

Best 3

Worst 3

Okay, time for some explanations as to what is going on here…

Overall Process

  1. Get annual series that would be nice to have monthly

  2. Get monthly series related to the annual series

  3. Do required data cleaning, and feature engineering for time series

  4. Train xgboost model on matching annual values for annual target x monthly training data

  5. Feed hold out monthly training data into model to get estimated annual series in monthly format

1. Get annual trade data

I used UNCOMTRADE product level import/export series

2 and 3. Get training data

  • Using dbnomics I download the Global Economic Monitor GEM from the World Bank

  • The data release is long but it has global macro variables monthly in a single dataset.

  • There are not many series, just:

    • Core CPI,seas.adj
    • CPI Price, seas. adj
    • Imports Merchandise, Customs, current US$, millions, seas. adj
    • Imports Merchandise, Customs, constant US$, millions, seas. adj
    • Imports Merchandise, Customs, Price, US$, seas. adj
    • Official exchange rate, LCU per USD, period average
    • Exchange rate, new LCU per USD extended backward, period average
    • Exchange rate, old LCU per USD extended forward, period average
    • Stock Markets, US$
    • Stock Markets, LCU
    • Merchandise, Customs, current US$, millions, seas. adj
    • Exports Merchandise, Customs, constant US$, millions, seas. adj
    • Merchandise, Customs, Price, US$, seas. adj
    • J.P. Morgan Emerging Markets Bond Spread (EMBI+)
    • J.P. Morgan Emerging Markets Bond Index(EMBI+)
    • Months Import Cover of Foreign Reserves
    • Industrial Production, constant US$, seas. adj
    • Nominal Effecive Exchange Rate
    • GDP,current US$,millions,seas. adj
    • GDP,current LCU,millions,seas. adj
    • GDP,constant 2010 US$,millions,seas. adj
    • GDP,constant 2010 LCU,millions,seas. adj
    • Real Effective Exchange Rate
    • Retail Sales Volume,Index
    • Terms of Trade
    • Total Reserves
    • Unemployment rate,Percent
  • I also used the IMF DOTS trade balance data

  • I convert these series into annual percent change

  • Then use an augmented dickey fuller test to filter out non-stationary series

  • The remaining series will be used to nowcast

  • I also got data from the IMF but didn’t have time to properly merge it into the training data.

4.

  • I hyperparameter tuned an xgboost model for each series
  • Training was on all years excpet for the final 3, which were held out for validation

Discussion