class: center, middle, inverse, title-slide .title[ # Introduction to Time Series ] .author[ ### Zhentao Shi ] .date[ ### Aug 25, 2021 ] --- ## Observations over time - Natural ordering of observations - A single realization in history -- - Macroeconomic applications - [FRED database](https://research.stlouisfed.org/econ/mccracken/fred-databases/) - Financial applications - [Yahoo Finance](https://finance.yahoo.com/) --- ## US GDP ```r USA= Quandl::Quandl("UNAE/GDPCD_USA") TT = dim(USA)[1] USA = USA[ rev(1:TT), ] plot( x = USA$Date, y = USA[ , 10], xlab = "year", ylab = "GDP") ``` <img src="ts_slides1_files/figure-html/fig_gdp-1.png" width="50%" /> --- ## USA Industrial Production * Another example: [Quarterly US Industrial Production Index](https://fred.stlouisfed.org/series/IPB50001SQ) -- .pull-left[ ```r quantmod::getSymbols.FRED( Symbols = "IPB50001SQ", env = .GlobalEnv) ``` ``` ## [1] "IPB50001SQ" ``` ] .pull-right[ ```r plot(IPB50001SQ) ``` ![](ts_slides1_files/figure-html/unnamed-chunk-1-1.png)<!-- --> ] --- ## S&P 500 Index ```r SPX <- quantmod::getSymbols("^GSPC", auto.assign = FALSE, from = "2000-01-01")$GSPC.Close plot(SPX) ``` <img src="ts_slides1_files/figure-html/unnamed-chunk-2-1.png" width="50%" /> --- ## S&P 500 Return ```r plot( diff( log(SPX) ) ) ``` <img src="ts_slides1_files/figure-html/unnamed-chunk-3-1.png" width="50%" /> --- ## Bitcoin ```r BTC <- quantmod::getSymbols("BTC-USD", auto.assign = FALSE, from = "2021-07-01")[,4] plot(BTC) ETH <- quantmod::getSymbols("ETH-USD", auto.assign = FALSE, from = "2021-07-01")[,4] plot(ETH) ``` <img src="ts_slides1_files/figure-html/unnamed-chunk-4-1.png" width="40%" /><img src="ts_slides1_files/figure-html/unnamed-chunk-4-2.png" width="40%" /> --- ```r plot( x = as.vector(ETH), y = as.vector(BTC), type = "l") ``` ![](ts_slides1_files/figure-html/unnamed-chunk-5-1.png)<!-- --> --- ## Bitcoin return ```r plot( diff( log(BTC) ) ) ``` <img src="ts_slides1_files/figure-html/unnamed-chunk-6-1.png" width="50%" /> --- ## Exchange rates ```r quantmod::getFX("USD/JPY") ``` ``` ## [1] "USD/JPY" ``` ```r quantmod::getFX("HKD/JPY") ``` ``` ## [1] "HKD/JPY" ``` --- ```r matplot( y = cbind(USDJPY, HKDJPY*7.8), x = index(USDJPY), type = "l", xlab = "time" ) ``` ![](ts_slides1_files/figure-html/unnamed-chunk-8-1.png)<!-- --> --- ## Understanding time series * Structural versus non-structural * Model time series * Extrapolate time series * Nowcast * Forecast <!-- ## My research --> <!-- * Time series prediction --> <!-- * 2021: "[Unfolding Beijing in a Hedonic Way](https://www.researchgate.net/publication/339551353_Unfolding_Beijing_in_a_Hedonic_Way)," with Wei Lin, Yishu Wang and Ting Hin Yan, working paper --> <!-- * 2021: "[High Dimensional Forecast Combinations Under Latent Structures](https://arxiv.org/abs/2010.09477)," with [Liangjun Su](http://www.sem.tsinghua.edu.cn/en/suliangjun) and [Tian Xie](https://cob.sufe.edu.cn/en/Home/Teachers_Details/201?typeId=1156), arXiv: 2010.09477, working paper --> <!-- * 2021: Ji Hyung Lee, ZS and Zhan Gao, "[On LASSO for Predictive Regression](https://www.sciencedirect.com/science/article/pii/S030440762100049X)," *Journal of Econometrics* --> <!-- * 2021: Kayan Cheng, Naijing Huang and ZS, "[Survay-Based Forecasting: To Average or Not To Average,](https://doi.org/10.1007/978-3-030-49728-6_5)" in Vladik Kreinovich, Songsak Sriboonchitta, Woraphon Yamaka (eds.), *Studies in Computational Intelligence: Behavioral Predictive Modeling in Economics*, vol. 897, pp 87-104, Springer-Verlag --> <!-- ## My research (continue) --> <!-- * Time series structure --> <!-- * 2021: Peter Phillips and ZS, "[Boosting: Why You Can Use the HP Filter,](https://onlinelibrary.wiley.com/doi/10.1111/iere.12495)" *International Economic Review*, 62(2), 521-570 --> <!-- * 2018: ZS and Huanhuan Zheng, "[Structural Estimation of Behavioral Heterogeneity,](https://onlinelibrary.wiley.com/doi/abs/10.1002/jae.2640)" *Journal of Applied Econometrics*, 33(5), 690-707 --> <!-- * 2009: James Chu, Liping Lu and ZS, "[Pitfalls in Market Timing Test,](http://www.sciencedirect.com/science/article/pii/S0165176509000391)" *Economic Letters*, 103(3), 123–126 --> <!-- * Panel data --> <!-- * 2021: ZS and Jingyi Huang, "[Forward-Selected Panel Data Approach for Program Evaluation](https://www.sciencedirect.com/science/article/pii/S0304407621001536?via%3Dihub)," *Journal of Econometrics* --> <!-- * 2016: Liangjun Su, ZS and Peter Phillips, "[Identifying Latent Structures in Panel Data,](https://onlinelibrary.wiley.com/doi/abs/10.3982/ECTA12560)" *Econometrica*, 84(6), 2215-2264 -->