0

Hey guys i am new in this forum.

I am also new into programming with R or Stata(and programming in total, but i really would like to learn it). Currently I am writing a thesis about whether its possible to predict the future of an index with the use of the google trend datas. My professor suggested me to learn R and built an AR(I)MA model in there. I watched some tutorials about using an ARIMA model in R but they were just for one time series. I couldnt find one with two time series. I am not sure if its allowed to post the youtube video in here(but if you want to see that tutorial let me know :D).

So my question is if anybody has a good source where I can learn how to build up a good model for my thesis.

I am thankful for everykind of help.

best regards sense

Richard Hardy
  • 54,375
  • 10
  • 95
  • 219
sense
  • 17
  • 4
  • 1
    Some relevant keywords: ARIMAX, regression with ARMA errors, vector autoregression (VAR). There are quite a few threads on these topics here on Cross Validated. – Richard Hardy Jan 13 '20 at 10:25

2 Answers2

0

I think what you're looking for are ARIMAX models. It's basically arima with xreg= argument including the exogenous variables.

Here are some links to shed some light on your tasks: https://robjhyndman.com/hyndsight/arimax/ https://stackoverflow.com/questions/15681529/forecasting-using-arimax-in-r https://cran.r-project.org/web/packages/forecast/forecast.pdf

And of course, the Bible of forecasting: https://otexts.com/fpp2/regarima.html

0

How to use Dynamic Regression models in R to forecast future sales should help . Note that VAR models don't allow for contemporaneous structure as all variables enter with only lags. You might also look at https://autobox.com/pdfs/regvsbox-old.pdf to get some perspective on "Regression vs Box-Jenkins".

IrishStat
  • 27,906
  • 5
  • 29
  • 55
  • Good point about VAR. However, you can redefine a variable by lagging/advancing it like $z_{t-1}:=x_{t}$, and then VAR will work for contemporaneous variables, too. Structural VAR (SVAR) allows for contemporaneous relationships as well. – Richard Hardy Jan 13 '20 at 17:27