I'm planning to do a multivariate time series forecasting using ARIMA errors with Fourier terms.

Data assumptions:

  • moderate seasonality
  • one independent variable ($x$)
  • one dependent variable ($y$)
  • Weekly data collected for 148 weeks.

$y$ has some good correlation with $x$. So planning to forecast $y$ based on the correlation with $x$ along with the Fourier values of $y$.

df.y<-ts(y, frequency=52)
zx.f<-fourier(df.x, K=2,h=26) #fourier values of x variable
forecast.x<-auto.arima(df.x,xreg=zx.f,approximation=F,h=26) #forecast values of x

zy.f<-fourier(df.y,K=2,h=26) #fourier values of y variable
forecast.y<-auto.arima(df.y,xreg=cbind(forecast.x,zy.f),approximation=F,h=26) #forecast y using 
fourier values of y and forecast values of x

I have just used cbind on the xreg parameter to use both forecasted variable ($x$) and Fourier values of $y$. Is it right to use forecasted values of $x$ and Fourier values of $y$ when forecasting the $y$ variable?


1 Answer 1


It is not only correct but also your only alternative in a situation where you do not have an external source that provides you with the forecasts associated with your variable df.x. However, you should consider that the error associated with performing forecasts of the external variable will also propagate to the forecast of the time series of interest, df.y. It may be useful to divide the problem into two stages: one that fits a suitable model for the x-series and forecasts its values to the necessary horizon, and then use those forecasts to specify the dynamic regression model you propose.

  • $\begingroup$ Thank you.. But still is it right to use two variables (Forecasted values of x-forecast.z and Fourier values of my time series of interest zy.f) on the xreg parameter of auto.arima while forecasting the independent variable df.y? is it right to put forecast.z(first) and zy.f(second) on the xreg parameter? as i just want the forecast to consider both these regressor variables while generating point forecasts of y.(df.y) $\endgroup$ Commented Nov 22, 2021 at 4:54
  • $\begingroup$ I recommend that you separate the ARIMA model fitting with its forecast. You should pay attention in this case to forecast.y, because in xreg you should add df.x instead of its forecast, forecast.x, next to the fourier coefficients, while fitting. Once the model is fitted, you can use the forecast method to forecast and pass a new xreg with forecast.x and future fourier coefficients. I hope my explanation is understandable. $\endgroup$ Commented Nov 23, 2021 at 13:28
  • $\begingroup$ Thank you.. Could you please take a look at this thread- stats.stackexchange.com/q/553351/289500 I have posted my data here and I have tried to do the same and I get an error when I use multiple co-variates while forecasting dependent variable. $\endgroup$ Commented Nov 23, 2021 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.