Start by cloning the Git repsitory:
git clone https://github.com/lena-will/GDP-nowcasting.git
This repository holds the code for my seminar project on GDP nowcasting using Google Trends Data. It mainly follows Ferrara and Simoni (2022) with an additional comparison to the elastic net estimator (Zou and Hastie (2005)).
Data and scripts to get data can be found in the Data prep
folder.
- Google Trends Data scraped via the
gtrendsR
function (find code ingetGTD.R
and data ingtd_categories.csv
) - For convenience, macro data for Germany is summarised in
macro_data.xlsx
. The data sources are respectively:- Quarterly GDP
- IP Index (specifically: Produktion im produzierenden Gewerbe ohne Bau)
- ESI Index
- The main script that runs the ridge after model selection estimations is
Ridge_after_model_selection.R
. All functions that the main file calls are in the folderfunctions
. - Scripts to any plots are in
plots
. Elastic_net.R
holds the code to the elastic net estimation, respective functions are again in thefunctions
folder.
(1) Ferrara, Laurent and Simoni, Anna (2022). "When are Google Data Useful to Nowcast GDP? An Approach via Preselection and Shrinkage". In: Journal of Business & Economic Statistics, Vol. 00, No. 0, pp. 1–15.
(2) Zou, Hui and Hastie, Trevor (2005). "Regularization and Variable Selection via the Elastic Net". In: Journal of the Royal Statistical Society. Series B (Statistical Methodology), Vol. 67, No. 2, pp. 301-320.